|
Blender V4.3
|
Namespaces | |
| namespace | pixels |
| namespace | uv_islands |
Classes | |
| struct | BMeshNode |
| struct | BoundsMergeInfo |
| class | DrawCache |
| struct | EdgeQueue |
| struct | EdgeQueueContext |
| struct | FastNodeBuildInfo |
| struct | GridsNode |
| struct | MeshNode |
| class | Node |
| struct | node_tree |
| struct | PBVHIter |
| struct | RaycastData |
| struct | StackItem |
| class | Tree |
Enumerations | |
| enum class | Type { Mesh , Grids , BMesh } |
| enum | PlaneAABBIsect { ISECT_INSIDE , ISECT_OUTSIDE , ISECT_INTERSECT } |
Functions | |
| void | build_pixels (const Depsgraph &depsgraph, Object &object, Image &image, ImageUser &image_user) |
| void | raycast (Tree &pbvh, FunctionRef< void(Node &node, float *tmin)> cb, const float3 &ray_start, const float3 &ray_normal, bool original) |
| 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, IsectRayPrecalc *isect_precalc, float *depth, bool use_original, BMVert **r_active_vertex, float3 &r_face_normal) |
| bool | raycast_node_detail_bmesh (BMeshNode &node, const float3 &ray_start, 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) |
| void | set_frustum_planes (Tree &pbvh, PBVHFrustumPlanes *planes) |
| void | get_frustum_planes (const Tree &pbvh, PBVHFrustumPlanes *planes) |
| Bounds< float3 > | bounds_get (const Tree &pbvh) |
| int | count_grid_quads (const BitGroupVector<> &grid_visibility, 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 float center[3], const float view_normal[3], 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) |
| Bounds< float3 > | node_bounds (const Node &node) |
| void | update_bounds (const Depsgraph &depsgraph, const Object &object, Tree &pbvh) |
| void | update_bounds_mesh (Span< float3 > vert_positions, Tree &pbvh) |
| void | update_bounds_grids (const CCGKey &key, Span< float3 > positions, Tree &pbvh) |
| void | update_bounds_bmesh (const BMesh &bm, Tree &pbvh) |
| 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_visibility (const Object &object, 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) |
| void | flush_bounds_to_parents (Tree &pbvh) |
| static Bounds< float3 > | negative_bounds () |
| static Bounds< float3 > | merge_bounds (const Bounds< float3 > &a, const Bounds< float3 > &b) |
| static int | partition_along_axis (const Span< float3 > face_centers, MutableSpan< int > faces, const int axis, const float middle) |
| static int | partition_material_indices (const Span< int > material_indices, MutableSpan< int > faces) |
| 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 bool | leaf_needs_material_split (const Span< int > faces, const Span< int > material_indices) |
| static void | build_nodes_recursive_mesh (const Span< int > material_indices, const int leaf_limit, const int node_index, const std::optional< Bounds< float3 > > &bounds_precalc, const Span< float3 > face_centers, const int depth, MutableSpan< int > faces, Vector< MeshNode > &nodes) |
| Bounds< float3 > | calc_face_bounds (const Span< float3 > vert_positions, const Span< int > face_verts) |
| static void | build_nodes_recursive_grids (const Span< int > material_indices, const int leaf_limit, const int node_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, PBVHNodeFlags leaf_flag) |
| static Node * | pbvh_iter_next_occluded (PBVHIter *iter) |
| static void | node_tree_insert (node_tree *tree, node_tree *new_node) |
| static void | traverse_tree (node_tree *tree, const FunctionRef< void(Node &node, float *tmin)> hit_fn, float *tmin) |
| static void | free_tree (node_tree *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 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 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_normals (Object &object_orig, Object &object_eval, Tree &pbvh) |
| template<typename NodeT > | |
| static BoundsMergeInfo | merge_child_bounds (MutableSpan< NodeT > nodes, const BitSpan dirty, const int node_index) |
| 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, 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 PBVHFrustumPlanes *frustum) |
| 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 Vector< Node * > | search_gather (Tree &pbvh, const FunctionRef< bool(Node &)> scb, PBVHNodeFlags 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, 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, 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 float co[3], const float no[3], 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, 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, 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 *q, BMFace *f) |
| static bool | edge_queue_tri_in_circle (const EdgeQueue *q, BMFace *f) |
| static bool | check_mask (EdgeQueueContext *eq_ctx, BMVert *v) |
| static void | edge_queue_insert (EdgeQueueContext *eq_ctx, BMEdge *e, 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 (EdgeQueueContext *eq_ctx, BMEdge *e) |
| static void | long_edge_queue_edge_add_recursive (EdgeQueueContext *eq_ctx, BMLoop *l_edge, BMLoop *l_end, const float len_sq, float limit_len) |
| static void | short_edge_queue_edge_add (EdgeQueueContext *eq_ctx, BMEdge *e) |
| static void | long_edge_queue_face_add (EdgeQueueContext *eq_ctx, BMFace *f) |
| static void | short_edge_queue_face_add (EdgeQueueContext *eq_ctx, BMFace *f) |
| static void | long_edge_queue_create (EdgeQueueContext *eq_ctx, const float max_edge_len, MutableSpan< BMeshNode > nodes, const float center[3], const float view_normal[3], float radius, const bool use_frontface, const bool use_projected) |
| static void | short_edge_queue_create (EdgeQueueContext *eq_ctx, const float min_edge_len, MutableSpan< BMeshNode > nodes, const float center[3], const float view_normal[3], float radius, const bool use_frontface, const bool use_projected) |
| static void | copy_edge_data (BMesh &bm, BMEdge &dst, BMEdge &src) |
| static void | merge_edge_data (BMesh &bm, BMEdge &dst, const BMEdge &src) |
| static void | pbvh_bmesh_split_edge (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 (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, BMFace *del_face, BMFace *flap_face, BMEdge *e, BMVert *v_del, 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, BMLoop *l_del, 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, GHash *deleted_verts, EdgeQueueContext *eq_ctx) |
| static bool | pbvh_bmesh_collapse_short_edges (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, 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, FastNodeBuildInfo *node, int node_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 (BMFace *f) |
| static BMFace * | bm_face_exists_tri_from_loop_vert (BMLoop *l_radial_first, BMVert *v_opposite) |
| static BMVert * | bm_vert_hash_lookup_chain (GHash *deleted_verts, BMVert *v) |
Variables | |
| constexpr int | leaf_limit = 400 |
|
strong |
| Enumerator | |
|---|---|
| Mesh | |
| Grids | |
| BMesh | |
Definition at line 20 of file BKE_pbvh.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 2612 of file pbvh.cc.
References blender::index_mask::IndexMask::from_predicate(), blender::bke::pbvh::Tree::nodes_, and PBVH_Leaf.
Referenced by blender::ed::sculpt_paint::smooth::blur_geometry_data_array(), 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::cloth::cloth_sim_initialize_default_node_state(), blender::ed::sculpt_paint::do_brush_action(), 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::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::undo::restore_face_set_from_undo_step(), 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::mask::sculpt_mask_filter_exec(), blender::ed::sculpt_paint::mask::sculpt_mask_init_exec(), vertex_color_set_exec(), and blender::ed::sculpt_paint::hide::visibility_invert_exec().
|
static |
Definition at line 124 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 | ( | BMFace * | f | ) |
Definition at line 133 of file pbvh_bmesh.cc.
References BLI_assert, BM_FACE_FIRST_LOOP, l, BMFace::len, BMLoop::next, result, and BMLoop::v.
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 165 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 185 of file pbvh_bmesh.cc.
References BLI_ghash_lookup_p(), 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, | ||
| bool | use_original ) |
Definition at line 1975 of file pbvh_bmesh.cc.
References BLI_assert, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_face_as_array_vert_tri(), and ray_face_nearest_tri().
Referenced by find_nearest_to_ray_node().
Definition at line 2012 of file pbvh_bmesh.cc.
References BM_face_normal_update(), BM_vert_normal_update(), blender::index_mask::IndexMask::foreach_index(), and blender::bke::pbvh::Tree::nodes().
Referenced by 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 float | center[3], | ||
| const float | view_normal[3], | ||
| float | radius, | ||
| bool | use_frontface, | ||
| bool | use_projected ) |
Collapse short edges, subdivide long edges.
Definition at line 2289 of file pbvh_bmesh.cc.
References BKE_pbvh_bmesh_node_save_orig(), BLI_assert, 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::index_mask::IndexMask::from_bools(), blender::bke::pbvh::EdgeQueue::heap, len_squared_v3(), long_edge_queue_create(), blender::bke::pbvh::Tree::nodes(), pbvh_bmesh_collapse_short_edges(), pbvh_bmesh_node_drop_orig(), pbvh_bmesh_subdivide_long_edges(), PBVH_Collapse, PBVH_Leaf, PBVH_Subdivide, PBVH_TopologyUpdated, PBVH_UpdateTopology, BMesh::pdata, short_edge_queue_create(), blender::bke::pbvh::Tree::tag_positions_changed(), blender::bke::pbvh::Tree::tag_topology_changed(), and BMesh::vdata.
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 1480 of file pbvh.cc.
References blender::bke::pbvh::Tree::nodes_.
Referenced by blender::ed::sculpt_paint::ensure_valid_pivot(), blender::workbench::Instance::object_sync(), blender::draw::Manager::resource_handle_for_sculpt(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), and blender::eevee::SyncModule::sync_sculpt().
|
static |
Definition at line 87 of file pbvh.cc.
References blender::threading::parallel_for(), and SCOPED_TIMER_AVERAGED.
Referenced by blender::bke::pbvh::Tree::from_mesh().
|
static |
Definition at line 304 of file pbvh.cc.
References bounds(), build_nodes_recursive_grids(), blender::math::dominant_axis(), blender::Span< T >::drop_front(), faces, blender::bke::pbvh::Node::flag_, leaf_limit, leaf_needs_material_split(), merge_bounds(), blender::math::midpoint(), blender::math::min_max(), negative_bounds(), partition_along_axis(), partition_material_indices(), PBVH_Leaf, split(), STACK_FIXED_DEPTH, and blender::Span< T >::take_front().
Referenced by build_nodes_recursive_grids(), and blender::bke::pbvh::Tree::from_grids().
|
static |
Definition at line 151 of file pbvh.cc.
References bounds(), build_nodes_recursive_mesh(), blender::math::dominant_axis(), blender::Span< T >::drop_front(), faces, blender::bke::pbvh::Node::flag_, leaf_limit, leaf_needs_material_split(), merge_bounds(), blender::math::midpoint(), blender::math::min_max(), negative_bounds(), partition_along_axis(), partition_material_indices(), PBVH_Leaf, split(), STACK_FIXED_DEPTH, and blender::Span< T >::take_front().
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 490 of file pbvh_pixels.cc.
References depsgraph, blender::bke::object::pbvh_get(), and blender::bke::pbvh::pixels::update_pixels().
|
static |
Definition at line 895 of file pbvh.cc.
References blender::Span< T >::index_range(), and blender::threading::parallel_for().
Referenced by update_normals_mesh().
|
static |
Definition at line 932 of file pbvh.cc.
References blender::threading::parallel_for(), and verts.
|
inline |
Definition at line 224 of file pbvh.cc.
References bounds(), calc_face_bounds(), blender::Span< T >::first(), blender::math::min_max(), blender::Span< T >::size(), and blender::Span< T >::slice().
Referenced by calc_face_bounds(), and blender::bke::pbvh::Tree::from_mesh().
|
static |
Definition at line 377 of file pbvh.cc.
References bounds(), calc_face_grid_bounds(), blender::math::min_max(), and negative_bounds().
Referenced by calc_face_grid_bounds(), and blender::bke::pbvh::Tree::from_grids().
|
static |
Definition at line 1889 of file pbvh.cc.
References copy_v3_v3(), len_squared_v3v3(), and normal_quad_v3().
Referenced by node_raycast_grids().
|
static |
Definition at line 1776 of file pbvh.cc.
References len_squared_v3v3(), and normal_tri_v3().
Referenced by node_raycast_mesh().
|
static |
Definition at line 906 of file pbvh.cc.
References faces, blender::index_mask::IndexMask::foreach_index(), and normals_calc_faces().
Referenced by update_normals_mesh().
|
static |
Definition at line 942 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), normals_calc_verts_simple(), and verts.
|
static |
Return true if the vertex mask is less than 1.0, false otherwise.
Definition at line 779 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 2013 of file pbvh.cc.
References add_v3_v3(), axis_dominant_v3_to_m3(), b, BKE_pbvh_node_get_original_BB(), 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, mid_v3_v3v3(), blender::Bounds< T >::min, min, minmax_v3v3_v3(), mul_m3_v3(), mul_v3_v3fl(), node_bounds(), sub_v3_v3v3(), and tree_is_empty().
Referenced by SCULPT_raycast_init().
Copy custom data from src to dst edge.
Definition at line 1144 of file pbvh_bmesh.cc.
References bm, CustomData_bmesh_copy_block(), BMHeader::data, BMesh::edata, BMEdge::head, and BMHeader::hflag.
Referenced by pbvh_bmesh_split_edge().
|
static |
Definition at line 2398 of file pbvh_bmesh.cc.
References BM_log_find_original_vert_co(), BMVert::co, copy_original_vert(), log(), and v.
Referenced by BKE_pbvh_bmesh_node_save_orig(), and copy_original_vert().
| int blender::bke::pbvh::count_grid_quads | ( | const BitGroupVector<> & | grid_visibility, |
| Span< int > | grid_indices, | ||
| int | gridsize, | ||
| int | display_gridsize ) |
Returns the number of visible quads in the nodes' grids.
Definition at line 1403 of file pbvh.cc.
References int, blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), paint_is_grid_face_hidden(), and blender::Span< T >::size().
Referenced by blender::draw::pbvh::create_tri_index_grids().
|
static |
Definition at line 1699 of file pbvh.cc.
References copy_v3_v3(), dist_squared_ray_to_seg_v3(), FLT_MAX, and v2.
Referenced by ray_face_nearest_quad(), and ray_face_nearest_tri().
|
static |
Definition at line 784 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::q.
Referenced by long_edge_queue_edge_add(), long_edge_queue_edge_add_recursive(), and short_edge_queue_edge_add().
Definition at line 759 of file pbvh_bmesh.cc.
References BM_face_as_array_vert_tri(), blender::bke::pbvh::EdgeQueue::center_proj, closest_on_tri_to_point_v3(), len_squared_v3v3(), 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 745 of file pbvh_bmesh.cc.
References BM_face_as_array_vert_tri(), blender::bke::pbvh::EdgeQueue::center, closest_on_tri_to_point_v3(), BMVert::co, len_squared_v3v3(), and blender::bke::pbvh::EdgeQueue::radius_squared.
Referenced by long_edge_queue_create(), and short_edge_queue_create().
|
static |
Definition at line 853 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, SculptSession::face_normals_deform, Mesh, mesh_topology_count_matches(), Object::mode, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, blender::bke::object::pbvh_get(), Mesh::runtime, Object::sculpt, and Mesh::verts_num.
Referenced by face_normals_cache_eval_for_write(), and face_normals_eval_from_eval().
|
static |
Definition at line 877 of file pbvh.cc.
References face_normals_cache_eval().
Referenced by update_normals_mesh().
Definition at line 2516 of file pbvh.cc.
References BLI_assert, DEG_get_original_object(), DEG_is_original_object(), and face_normals_cache_eval().
Referenced by blender::draw::pbvh::fill_vbos_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 2125 of file pbvh.cc.
References dist_squared_ray_to_aabb_v3_precalc(), nearest_to_ray_aabb_dist_sq(), and search_callback_occluded().
Referenced by SCULPT_stroke_get_location_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 2263 of file pbvh.cc.
References BLI_assert_unreachable, BMesh, bmesh_node_nearest_to_ray(), Grids, Mesh, pbvh_faces_node_nearest_to_ray(), PBVH_FullyHidden, pbvh_grids_node_nearest_to_ray(), and blender::bke::pbvh::Tree::type().
Referenced by 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 1447 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 605 of file pbvh.cc.
References BLI_assert, blender::bke::pbvh::Tree::nodes_, and tree_is_empty().
Referenced by clip_ray_ortho(), and pbvh_iter_begin().
| void blender::bke::pbvh::flush_bounds_to_parents | ( | Tree & | pbvh | ) |
Run the last step of the BVH bounds recalculation process, propagating updated leaf node bounds to their parent/ancestor inner nodes. This is meant to be used after leaf node bounds have been computed separately.
Definition at line 1132 of file pbvh.cc.
References blender::bke::pbvh::BoundsMergeInfo::bounds, blender::bke::pbvh::Tree::bounds_dirty_, blender::bits::BitVector< InlineBufferCapacity, Allocator >::clear_and_shrink(), merge_child_bounds(), and blender::bke::pbvh::Tree::nodes_.
Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_displacement_eraser_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::do_snake_hook_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::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::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(), update_bounds_bmesh(), update_bounds_grids(), and update_bounds_mesh().
|
static |
Definition at line 749 of file pbvh.cc.
References free(), free_tree(), and tree.
Referenced by free_tree(), and search_callback_occluded().
| void blender::bke::pbvh::get_frustum_planes | ( | const Tree & | pbvh, |
| PBVHFrustumPlanes * | planes ) |
Definition at line 2417 of file pbvh.cc.
References copy_v4_v4(), blender::bke::pbvh::Tree::num_planes_, and blender::bke::pbvh::Tree::planes_.
Referenced by blender::draw::sculpt_batches_get_ex().
|
static |
Return true if the edge is a boundary edge: both its vertices are on a boundary.
Definition at line 809 of file pbvh_bmesh.cc.
References BM_edge_is_manifold(), BM_ELEM_SEAM, and BM_ELEM_SMOOTH.
Referenced by is_boundary_vert(), and short_edge_queue_priority().
|
static |
Definition at line 827 of file pbvh_bmesh.cc.
References BM_DISK_EDGE_NEXT, 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 844 of file pbvh_bmesh.cc.
References is_boundary_vert().
Referenced by short_edge_queue_priority().
|
static |
Definition at line 140 of file pbvh.cc.
References blender::Span< T >::is_empty(), and leaf_needs_material_split().
Referenced by build_nodes_recursive_grids(), build_nodes_recursive_mesh(), and leaf_needs_material_split().
|
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 1032 of file pbvh_bmesh.cc.
References 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::EdgeQueue::heap, blender::bke::pbvh::EdgeQueue::limit_len, blender::bke::pbvh::EdgeQueue::limit_len_squared, long_edge_queue_face_add(), PBVH_FullyHidden, PBVH_Leaf, PBVH_UpdateTopology, project_plane_normalized_v3_v3v3(), blender::bke::pbvh::EdgeQueueContext::q, blender::bke::pbvh::EdgeQueue::radius_squared, UNUSED_VARS, blender::bke::pbvh::EdgeQueue::use_view_normal, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by bmesh_update_topology().
|
static |
Definition at line 888 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::q.
Referenced by long_edge_queue_face_add(), and pbvh_bmesh_split_edge().
|
static |
Definition at line 902 of file pbvh_bmesh.cc.
References ARRAY_SIZE, BLI_assert, BM_edge_calc_length_squared(), dot_v3v3(), BMLoop::e, e, edge_queue_insert(), EDGE_QUEUE_TEST, EVEN_EDGELEN_THRESHOLD, EVEN_GENERATION_SCALE, BMLoop::f, G, long_edge_queue_edge_add_recursive(), long_edge_queue_priority(), max_ff(), BMLoop::next, BMFace::no, BMLoop::prev, blender::bke::pbvh::EdgeQueueContext::q, BMLoop::radial_next, square_f(), UNLIKELY, blender::bke::pbvh::EdgeQueue::use_view_normal, 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 972 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(), long_edge_queue_edge_add_recursive(), BMLoop::next, BMFace::no, blender::bke::pbvh::EdgeQueueContext::q, BMLoop::radial_next, blender::bke::pbvh::EdgeQueue::use_view_normal, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by long_edge_queue_create(), and pbvh_bmesh_split_edge().
Definition at line 869 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 63 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().
|
static |
Definition at line 1113 of file pbvh.cc.
References blender::bke::pbvh::BoundsMergeInfo::bounds, blender::bounds::merge(), merge_child_bounds(), PBVH_Leaf, blender::bits::BitSpan::size(), blender::bke::pbvh::BoundsMergeInfo::update, and update().
Referenced by flush_bounds_to_parents(), and merge_child_bounds().
|
static |
Definition at line 1151 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 1521 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 1370 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().
|
static |
Logic used to test whether to use the evaluated mesh for positions.
Definition at line 816 of file pbvh.cc.
References b.
Referenced by face_normals_cache_eval(), vert_normals_cache_eval(), vert_positions_eval(), and vert_positions_eval_for_write().
|
static |
Definition at line 2102 of file pbvh.cc.
References dist_squared_ray_to_aabb_v3().
Referenced by find_nearest_to_ray().
Create invalid bounds for use with math::min_max.
Definition at line 58 of file pbvh.cc.
Referenced by BKE_pbvh_redraw_BB(), 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 119 of file pbvh_bmesh.cc.
Definition at line 1604 of file pbvh.cc.
Referenced by clip_ray_ortho(), blender::ed::sculpt_paint::node_in_cylinder(), and blender::ed::sculpt_paint::node_in_sphere().
| 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 1583 of file pbvh.cc.
References SubdivCCG::grid_to_face_map.
Referenced by blender::ed::sculpt_paint::undo::restore_face_set_from_undo_step().
| void blender::bke::pbvh::node_pixels_free | ( | blender::bke::pbvh::Node * | node | ) |
Definition at line 496 of file pbvh_pixels.cc.
Referenced by blender::bke::pbvh::Tree::~Tree().
| bool blender::bke::pbvh::node_raycast_bmesh | ( | BMeshNode & | node, |
| const float3 & | ray_start, | ||
| const float3 & | ray_normal, | ||
| IsectRayPrecalc * | isect_precalc, | ||
| float * | depth, | ||
| bool | use_original, | ||
| BMVert ** | r_active_vertex, | ||
| float3 & | r_face_normal ) |
Definition at line 1855 of file pbvh_bmesh.cc.
References BLI_assert, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_face_as_array_vert_tri(), copy_v3_v3(), cos(), len_squared_v3v3(), madd_v3_v3v3fl(), normal_tri_v3(), and ray_face_intersection_tri().
Referenced by 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 1923 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::Span< T >::index_range(), blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), blender::Span< T >::is_empty(), paint_is_grid_face_hidden(), SubdivCCG::positions, ray_face_intersection_quad(), blender::Span< T >::slice(), and x.
Referenced by 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 1807 of file pbvh.cc.
References calc_mesh_intersect_data(), blender::bke::mesh::face_triangles_range(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), and ray_face_intersection_tri().
Referenced by sculpt_raycast_cb().
Definition at line 714 of file pbvh.cc.
References blender::bke::pbvh::node_tree::data, node_tree_insert(), blender::bke::pbvh::Node::tmin_, and tree.
Referenced by node_tree_insert(), and search_callback_occluded().
Definition at line 1277 of file pbvh.cc.
References BLI_assert, BM_ELEM_CD_GET_FLOAT, PBVH_FullyMasked, PBVH_FullyUnmasked, 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::do_mask_brush(), blender::ed::sculpt_paint::mask::increase_contrast_mask_bmesh(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), blender::ed::sculpt_paint::mask::sculpt_mask_init_exec(), and update_mask_bmesh().
| void blender::bke::pbvh::node_update_mask_grids | ( | const CCGKey & | key, |
| Span< float > | masks, | ||
| GridsNode & | node ) |
Definition at line 1247 of file pbvh.cc.
References blender::bke::ccg::grid_range(), PBVH_FullyMasked, PBVH_FullyUnmasked, and SET_FLAG_FROM_TEST.
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::do_mask_brush(), blender::ed::sculpt_paint::mask::increase_contrast_mask_grids(), blender::ed::sculpt_paint::mask::init_mask_grids(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), and update_mask_grids().
Definition at line 1219 of file pbvh.cc.
References PBVH_FullyMasked, PBVH_FullyUnmasked, 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::do_mask_brush(), blender::ed::sculpt_paint::mask::increase_contrast_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 1358 of file pbvh.cc.
References PBVH_FullyHidden, and SET_FLAG_FROM_TEST.
Referenced by update_visibility_bmesh().
| void blender::bke::pbvh::node_update_visibility_grids | ( | const BitGroupVector<> & | grid_hidden, |
| GridsNode & | node ) |
Definition at line 1334 of file pbvh.cc.
References BLI_assert, blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), PBVH_FullyHidden, and SET_FLAG_FROM_TEST.
Referenced by blender::ed::sculpt_paint::hide::grid_hide_update(), blender::ed::sculpt_paint::hide::invert_visibility_grids(), and update_visibility_grids().
Definition at line 1310 of file pbvh.cc.
References BLI_assert, blender::Span< T >::is_empty(), PBVH_FullyHidden, SET_FLAG_FROM_TEST, and verts.
Referenced by blender::ed::sculpt_paint::hide::flush_face_changes_node(), 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 1462 of file pbvh.cc.
References SubdivCCG::faces, blender::index_mask::IndexMask::foreach_index(), blender::index_mask::IndexMask::from_bools(), and SubdivCCG::grid_to_face_map.
Referenced by update_normals().
|
static |
Definition at line 884 of file pbvh.cc.
References blender::bke::mesh::face_normal_calc(), and blender::Span< T >::slice().
Referenced by calc_node_face_normals().
|
static |
Definition at line 918 of file pbvh.cc.
References blender::math::normalize(), and verts.
Referenced by calc_node_vert_normals().
|
static |
Definition at line 68 of file pbvh.cc.
Referenced by build_nodes_recursive_grids(), and build_nodes_recursive_mesh().
|
static |
Definition at line 79 of file pbvh.cc.
Referenced by build_nodes_recursive_grids(), and build_nodes_recursive_mesh().
|
static |
Definition at line 1585 of file pbvh_bmesh.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), add_v3_v3(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, BLI_ghash_insert(), 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, blender::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(), BMLoop::prev, try_merge_flap_edge_data_before_dissolve(), BMLoop::v, and v2.
Referenced by pbvh_bmesh_collapse_short_edges().
|
static |
Definition at line 1779 of file pbvh_bmesh.cc.
References BLI_ghash_free(), BLI_ghash_ptr_new(), 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_INFO, 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::q, and v2.
Referenced by bmesh_update_topology().
|
static |
Definition at line 2141 of file pbvh_bmesh.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BM_ELEM_CD_GET_INT, BM_ELEM_CD_SET_INT, 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::children_offset_, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), DYNTOPO_NODE_NONE, blender::bke::pbvh::Node::flag_, BMLoop::next, pbvh_bmesh_create_nodes_fast_recursive(), PBVH_Leaf, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), BMLoop::v, and v.
Referenced by blender::bke::pbvh::Tree::from_bmesh(), and pbvh_bmesh_create_nodes_fast_recursive().
Definition at line 657 of file pbvh_bmesh.cc.
References BM_edge_face_count(), BM_edge_loop_pair(), BM_iter_as_array(), BM_LOOPS_OF_EDGE, e, and LIKELY.
Referenced by pbvh_bmesh_split_edge().
|
static |
Definition at line 469 of file pbvh_bmesh.cc.
References BLI_assert, bm, BM_CREATE_NOP, BM_ELEM_CD_SET_INT, BM_face_create(), BM_face_exists(), BM_log_face_added(), blender::Span< T >::data(), BMFace::head, BMHeader::hflag, and PBVH_TopologyUpdated.
Referenced by pbvh_bmesh_collapse_edge(), and pbvh_bmesh_split_edge().
|
static |
Definition at line 610 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, blender::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(), PBVH_TopologyUpdated, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), BMLoop::v, and v.
Referenced by pbvh_bmesh_collapse_edge(), and pbvh_bmesh_split_edge().
|
static |
Definition at line 670 of file pbvh_bmesh.cc.
Referenced by bmesh_update_topology().
|
static |
Update node data after splitting.
Definition at line 208 of file pbvh_bmesh.cc.
References blender::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_, BMVert::co, blender::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 423 of file pbvh_bmesh.cc.
References 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 416 of file pbvh_bmesh.cc.
References 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 409 of file pbvh_bmesh.cc.
References BLI_assert, 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 402 of file pbvh_bmesh.cc.
References BLI_assert, 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 359 of file pbvh_bmesh.cc.
References bm, BM_elem_index_set, BM_FACE, BM_FACE_FIRST_LOOP, blender::bke::pbvh::BMeshNode::bm_faces_, BMVert::co, BMesh::elem_index_dirty, leaf_limit, blender::math::min_max(), negative_bounds(), BMLoop::next, pbvh_bmesh_node_split(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), 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 2041 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(), leaf_limit, blender::Bounds< T >::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 254 of file pbvh_bmesh.cc.
References blender::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::bke::pbvh::BMeshNode::bm_unique_verts_, blender::bke::pbvh::Node::bounds_, blender::bke::pbvh::Node::bounds_orig_, blender::bke::pbvh::Node::children_offset_, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear_and_shrink(), blender::math::dominant_axis(), DYNTOPO_NODE_NONE, blender::bke::pbvh::Node::flag_, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), leaf_limit, blender::Bounds< T >::max, blender::bounds::merge(), blender::math::midpoint(), blender::Bounds< T >::min, min, blender::math::min_max(), negative_bounds(), pbvh_bmesh_node_finalize(), pbvh_bmesh_node_split(), PBVH_Leaf, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and v.
Referenced by pbvh_bmesh_node_limit_ensure(), and pbvh_bmesh_node_split().
|
static |
Definition at line 503 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 1163 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, BMVert::co, copy_edge_data(), e, BMLoop::f, blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), BMFace::len, long_edge_queue_edge_add(), long_edge_queue_face_add(), mid_v3_v3v3(), BMLoop::next, BMVert::no, normalize_v3(), 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 1284 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_INFO, 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::q, and v2.
Referenced by bmesh_update_topology().
|
static |
Definition at line 430 of file pbvh_bmesh.cc.
References BLI_assert, bm, BM_CREATE_NOP, BM_data_interp_from_verts(), BM_ELEM_CD_SET_INT, BM_log_vert_added(), BM_vert_create(), copy_v3_v3(), BMVert::no, PBVH_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 527 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 546 of file pbvh_bmesh.cc.
References blender::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_, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::bke::pbvh::Node::flag_, pbvh_bmesh_node_index_from_vert(), PBVH_TopologyUpdated, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), and v.
Referenced by pbvh_bmesh_face_remove(), and pbvh_bmesh_split_edge().
|
static |
Definition at line 574 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_, blender::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(), PBVH_TopologyUpdated, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), and v.
Referenced by pbvh_bmesh_collapse_edge().
|
static |
Definition at line 2140 of file pbvh.cc.
References blender::bke::mesh::face_triangles_range(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), and ray_face_nearest_tri().
Referenced by find_nearest_to_ray_node().
|
static |
Definition at line 2198 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::Span< T >::index_range(), blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), blender::Span< T >::is_empty(), paint_is_grid_face_hidden(), SubdivCCG::positions, ray_face_nearest_quad(), and blender::Span< T >::slice().
Referenced by find_nearest_to_ray_node().
|
static |
Definition at line 623 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 BKE_pbvh_redraw_BB(), search_callback_occluded(), and search_gather().
|
static |
Definition at line 630 of file pbvh.cc.
References blender::bke::pbvh::StackItem::node, 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 BKE_pbvh_redraw_BB(), and search_gather().
Definition at line 675 of file pbvh.cc.
References blender::bke::pbvh::StackItem::node, node, blender::bke::pbvh::Tree::nodes_, blender::bke::pbvh::PBVHIter::pbvh, PBVH_Leaf, 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 508 of file pbvh_pixels.cc.
References blender::bke::pbvh::Tree::pixels_.
Referenced by blender::bke::pbvh::Tree::~Tree().
|
static |
Definition at line 1634 of file pbvh.cc.
References isect_ray_aabb_v3(), blender::bke::pbvh::RaycastData::original, and blender::bke::pbvh::RaycastData::ray.
Referenced by raycast().
| 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 1657 of file pbvh.cc.
References isect_ray_tri_watertight_v3().
Referenced by node_raycast_grids().
| 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 1679 of file pbvh.cc.
References isect_ray_tri_watertight_v3().
Referenced by node_raycast_bmesh(), node_raycast_mesh(), 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 1723 of file pbvh.cc.
References dist_squared_ray_to_tri_v3_fast().
Referenced by pbvh_grids_node_nearest_to_ray().
| 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 1753 of file pbvh.cc.
References dist_squared_ray_to_tri_v3_fast().
Referenced by bmesh_node_nearest_to_ray(), and pbvh_faces_node_nearest_to_ray().
| 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 1642 of file pbvh.cc.
References isect_ray_aabb_v3_precalc(), blender::bke::pbvh::RaycastData::original, blender::bke::pbvh::RaycastData::ray, ray_aabb_intersect(), and search_callback_occluded().
| bool blender::bke::pbvh::raycast_node_detail_bmesh | ( | BMeshNode & | node, |
| const float3 & | ray_start, | ||
| IsectRayPrecalc * | isect_precalc, | ||
| float * | depth, | ||
| float * | r_edge_length ) |
Definition at line 1932 of file pbvh_bmesh.cc.
References BLI_assert, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_face_as_array_vert_tri(), len_squared_v3v3(), max_fff(), PBVH_FullyHidden, ray_face_intersection_tri(), and sqrtf.
Referenced by blender::ed::sculpt_paint::dyntopo::sculpt_raycast_detail_cb().
|
static |
Definition at line 773 of file pbvh.cc.
References blender::bke::pbvh::node_tree::data, FLT_MAX, free_tree(), blender::bke::pbvh::node_tree::left, node, node_tree_insert(), pbvh_iter_begin(), pbvh_iter_next_occluded(), PBVH_Leaf, blender::bke::pbvh::node_tree::right, traverse_tree(), tree, and tree_is_empty().
Referenced by find_nearest_to_ray(), and raycast().
|
static |
Definition at line 2624 of file pbvh.cc.
References node, pbvh_iter_begin(), pbvh_iter_next(), and tree_is_empty().
Referenced by 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 2647 of file pbvh.cc.
References blender::index_mask::IndexMask::from_indices(), indices, blender::bke::pbvh::Tree::nodes_, PBVH_Leaf, and search_gather().
Referenced by 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::do_enhance_details_brush(), 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(), blender::ed::sculpt_paint::gesture::update_affected_nodes_by_clip_planes(), and blender::ed::sculpt_paint::gesture::update_affected_nodes_by_line_plane().
| void blender::bke::pbvh::set_frustum_planes | ( | Tree & | pbvh, |
| PBVHFrustumPlanes * | planes ) |
Definition at line 2409 of file pbvh.cc.
References copy_v4_v4(), blender::bke::pbvh::Tree::num_planes_, and blender::bke::pbvh::Tree::planes_.
Referenced by blender::draw::sculpt_batches_get_ex().
|
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 1091 of file pbvh_bmesh.cc.
References 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::EdgeQueue::heap, blender::bke::pbvh::EdgeQueue::limit_len, blender::bke::pbvh::EdgeQueue::limit_len_squared, PBVH_FullyHidden, PBVH_Leaf, PBVH_UpdateTopology, project_plane_normalized_v3_v3v3(), blender::bke::pbvh::EdgeQueueContext::q, blender::bke::pbvh::EdgeQueue::radius_squared, short_edge_queue_face_add(), UNUSED_VARS, blender::bke::pbvh::EdgeQueue::use_view_normal, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by bmesh_update_topology().
|
static |
Definition at line 959 of file pbvh_bmesh.cc.
References BM_edge_calc_length_squared(), e, edge_queue_insert(), EDGE_QUEUE_TEST, and short_edge_queue_priority().
Referenced by short_edge_queue_face_add().
|
static |
Definition at line 1000 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::q, short_edge_queue_edge_add(), blender::bke::pbvh::EdgeQueue::use_view_normal, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by short_edge_queue_create().
Definition at line 874 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 1206 of file pbvh.cc.
References blender::threading::parallel_for().
Referenced by BKE_pbvh_vert_coords_apply(), blender::bke::pbvh::Tree::from_bmesh(), and blender::bke::pbvh::Tree::from_mesh().
|
static |
Definition at line 2321 of file pbvh.cc.
References dot_v3v3(), float, ISECT_INSIDE, ISECT_INTERSECT, ISECT_OUTSIDE, blender::Bounds< T >::max, blender::Bounds< T >::min, PBVHFrustumPlanes::num_planes, PBVHFrustumPlanes::planes, and ret.
Referenced by BKE_pbvh_node_frustum_contain_AABB(), and BKE_pbvh_node_frustum_exclude_AABB().
|
static |
Definition at line 734 of file pbvh.cc.
References traverse_tree(), and tree.
Referenced by search_callback_occluded(), and traverse_tree().
|
static |
Definition at line 600 of file pbvh.cc.
References blender::bke::pbvh::Tree::nodes_.
Referenced by BKE_pbvh_redraw_BB(), 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 1473 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_bounds | ( | const Depsgraph & | depsgraph, |
| const Object & | object, | ||
| Tree & | pbvh ) |
Recalculate node bounding boxes based on the current coordinates. Calculation is only done for affected nodes that have been tagged by #PBVH::tag_positions_changed().
Definition at line 1183 of file pbvh.cc.
References BKE_subdiv_ccg_key_top_level(), SculptSession::bm, BMesh, depsgraph, Grids, Mesh, SubdivCCG::positions, SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), update_bounds_bmesh(), update_bounds_grids(), update_bounds_mesh(), and vert_positions_eval().
Referenced by blender::ed::sculpt_paint::do_smooth_brush(), blender::ed::sculpt_paint::do_surface_smooth_brush(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_apply(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_cancel(), and blender::ed::sculpt_paint::vwpaint::update_cache_variants().
Definition at line 1170 of file pbvh.cc.
References blender::bke::pbvh::Tree::bounds_dirty_, flush_bounds_to_parents(), blender::index_mask::IndexMask::foreach_index(), blender::index_mask::IndexMask::from_bits(), blender::index_mask::IndexMask::is_empty(), blender::bke::pbvh::Tree::nodes(), and update_node_bounds_bmesh().
Referenced by blender::bke::pbvh::Tree::from_bmesh(), and update_bounds().
| void blender::bke::pbvh::update_bounds_grids | ( | const CCGKey & | key, |
| Span< float3 > | positions, | ||
| Tree & | pbvh ) |
Definition at line 1156 of file pbvh.cc.
References blender::bke::pbvh::Tree::bounds_dirty_, flush_bounds_to_parents(), blender::index_mask::IndexMask::foreach_index(), blender::index_mask::IndexMask::from_bits(), CCGKey::grid_area, blender::index_mask::IndexMask::is_empty(), blender::bke::pbvh::Tree::nodes(), and update_node_bounds_grids().
Referenced by update_bounds().
Definition at line 1143 of file pbvh.cc.
References blender::bke::pbvh::Tree::bounds_dirty_, flush_bounds_to_parents(), blender::index_mask::IndexMask::foreach_index(), blender::index_mask::IndexMask::from_bits(), blender::index_mask::IndexMask::is_empty(), blender::bke::pbvh::Tree::nodes(), and update_node_bounds_mesh().
Referenced by BKE_pbvh_vert_coords_apply(), blender::bke::pbvh::Tree::from_mesh(), and update_bounds().
| void blender::bke::pbvh::update_mask_bmesh | ( | const BMesh & | bm, |
| const IndexMask & | node_mask, | ||
| Tree & | pbvh ) |
Definition at line 1294 of file pbvh.cc.
References bm, CD_PROP_FLOAT, CustomData_get_offset_named(), blender::index_mask::IndexMask::foreach_index(), node_update_mask_bmesh(), blender::bke::pbvh::Tree::nodes(), PBVH_FullyUnmasked, and BMesh::vdata.
Referenced by blender::ed::sculpt_paint::do_smooth_mask_brush().
| void blender::bke::pbvh::update_mask_grids | ( | const SubdivCCG & | subdiv_ccg, |
| const IndexMask & | node_mask, | ||
| Tree & | pbvh ) |
Definition at line 1261 of file pbvh.cc.
References BKE_subdiv_ccg_key_top_level(), blender::index_mask::IndexMask::foreach_index(), blender::Array< T, InlineBufferCapacity, Allocator >::is_empty(), SubdivCCG::masks, node_update_mask_grids(), blender::bke::pbvh::Tree::nodes(), and PBVH_FullyUnmasked.
Referenced by blender::ed::sculpt_paint::do_smooth_mask_brush().
| 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 1230 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), node_update_mask_mesh(), blender::bke::pbvh::Tree::nodes(), PBVH_FullyUnmasked, and blender::bke::Point.
| void blender::bke::pbvh::update_node_bounds_bmesh | ( | BMeshNode & | node | ) |
Definition at line 1095 of file pbvh.cc.
References blender::Bounds< T >::max, blender::Bounds< T >::min, blender::math::min_max(), and negative_bounds().
Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::do_snake_hook_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::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::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 update_bounds_bmesh().
| void blender::bke::pbvh::update_node_bounds_grids | ( | int | grid_area, |
| Span< float3 > | positions, | ||
| GridsNode & | node ) |
Definition at line 1084 of file pbvh.cc.
References blender::bke::ccg::grid_range(), blender::Bounds< T >::max, blender::Bounds< T >::min, blender::math::min_max(), and negative_bounds().
Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_displacement_eraser_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::do_snake_hook_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::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::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 update_bounds_grids().
Definition at line 1075 of file pbvh.cc.
References blender::Bounds< T >::max, blender::Bounds< T >::min, blender::math::min_max(), and negative_bounds().
Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::do_snake_hook_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::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::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 update_bounds_mesh().
| void blender::bke::pbvh::update_normals | ( | const Depsgraph & | depsgraph, |
| Object & | object_orig, | ||
| Tree & | pbvh ) |
Definition at line 1058 of file pbvh.cc.
References BLI_assert, DEG_get_evaluated_object(), DEG_is_original_object(), depsgraph, and update_normals().
Referenced by blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter(), blender::ed::sculpt_paint::filter::calc_relax_filter(), blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), SCULPT_cursor_geometry_info_update(), update_normals(), and update_normals_from_eval().
|
static |
Definition at line 1030 of file pbvh.cc.
References BKE_subdiv_ccg_update_normals(), BMesh, bmesh_normals_update(), blender::bits::BitVector< InlineBufferCapacity, Allocator >::clear_and_shrink(), blender::index_mask::IndexMask::from_bits(), Grids, Mesh, blender::bke::pbvh::Tree::nodes(), nodes_to_face_selection_grids(), blender::bke::pbvh::Tree::normals_dirty_, Object::sculpt, SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), and update_normals_mesh().
Update geometry normals (potentially on the original object geometry).
Definition at line 1065 of file pbvh.cc.
References DEG_get_original_object(), and update_normals().
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 953 of file pbvh.cc.
References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple(), calc_boundary_face_normals(), calc_node_face_normals(), Object::data, face_normals_cache_eval_for_write(), blender::index_mask::IndexMask::foreach_index(), blender::SharedCache< T >::is_dirty(), blender::threading::parallel_invoke(), blender::SharedCache< T >::update(), vert_normals_cache_eval_for_write(), and vert_positions_eval_from_eval().
Referenced by update_normals().
Definition at line 1377 of file pbvh.cc.
References BMesh, blender::bits::BitVector< InlineBufferCapacity, Allocator >::clear_and_shrink(), blender::index_mask::IndexMask::from_bits(), Grids, blender::index_mask::IndexMask::is_empty(), Mesh, blender::bke::pbvh::Tree::nodes(), SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), update_visibility_bmesh(), update_visibility_faces(), update_visibility_grids(), and blender::bke::pbvh::Tree::visibility_dirty_.
Referenced by blender::ed::sculpt_paint::hide::grids_show_all(), blender::ed::sculpt_paint::hide::invert_visibility_mesh(), blender::ed::sculpt_paint::hide::mesh_show_all(), and blender::ed::sculpt_paint::hide::partialvis_update_bmesh_nodes().
|
static |
Definition at line 1371 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), and node_update_visibility_bmesh().
Referenced by update_visibility().
|
static |
Definition at line 1319 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), blender::Span< T >::is_empty(), node_update_visibility_mesh(), and blender::bke::Point.
Referenced by update_visibility().
|
static |
Definition at line 1344 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), SubdivCCG::grid_hidden, blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), and node_update_visibility_grids().
Referenced by update_visibility().
|
static |
Check whether the vert is adjacent to any face which are adjacent to the #edge.
Definition at line 1342 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 822 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, Mesh, mesh_topology_count_matches(), Object::mode, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, blender::bke::object::pbvh_get(), Mesh::runtime, Object::sculpt, SculptSession::vert_normals_deform, and Mesh::verts_num.
Referenced by vert_normals_cache_eval_for_write(), vert_normals_eval(), and vert_normals_eval_from_eval().
|
static |
Definition at line 846 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 the positions from vert_positions_eval. This may be a reference to the normals cache on the original mesh.
Definition at line 2502 of file pbvh.cc.
References DEG_get_evaluated_object(), depsgraph, and vert_normals_cache_eval().
Referenced by blender::ed::sculpt_paint::calc_area_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_foces(), blender::ed::sculpt_paint::cloth::copy_normals_to_array(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_mask_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::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::offset_positions(), blender::ed::sculpt_paint::sample_surface(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::set_persistent_base_exec(), and vpaint_do_draw().
Definition at line 2509 of file pbvh.cc.
References BLI_assert, DEG_get_original_object(), DEG_is_original_object(), and vert_normals_cache_eval().
Referenced by blender::draw::pbvh::fill_vbos_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 2482 of file pbvh.cc.
References DEG_get_evaluated_object(), depsgraph, and vert_positions_eval().
Referenced by SculptSession::active_vert_position(), blender::ed::sculpt_paint::average_unmasked_position(), blender::ed::sculpt_paint::calc_area_center(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), 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_foces(), blender::ed::sculpt_paint::cloth::copy_positions_to_array(), blender::ed::sculpt_paint::boundary::data_init_mesh(), blender::ed::sculpt_paint::do_mask_brush(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), 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::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::pose::grow_pose_factor(), blender::ed::sculpt_paint::boundary::init_boundary_mesh(), blender::ed::sculpt_paint::paint_cursor_draw_3d_view_brush_cursor_inactive(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::sample_surface(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), SCULPT_cursor_geometry_info_update(), SCULPT_stroke_get_location_ex(), SCULPT_vertex_is_occluded(), blender::ed::sculpt_paint::expand::spherical_falloff_create(), update_bounds(), blender::bke::pbvh::pixels::update_pixels(), vert_positions_eval(), vert_positions_eval_from_eval(), blender::ed::sculpt_paint::vert_positions_for_grab_active_get(), and vpaint_do_draw().
|
static |
Definition at line 2425 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, Mesh, mesh_topology_count_matches(), Object::mode, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, blender::bke::object::pbvh_get(), Object::sculpt, and Mesh::verts_num.
| 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 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 2496 of file pbvh.cc.
References DEG_get_evaluated_object(), depsgraph, and vert_positions_eval_for_write().
Referenced by blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), blender::ed::sculpt_paint::undo::restore_position_mesh(), and vert_positions_eval_for_write().
|
static |
Definition at line 2452 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, Mesh, mesh_topology_count_matches(), Object::mode, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, blender::bke::object::pbvh_get(), Object::sculpt, and Mesh::verts_num.
Definition at line 2489 of file pbvh.cc.
References BLI_assert, DEG_get_original_object(), DEG_is_original_object(), and vert_positions_eval().
Referenced by blender::draw::pbvh::fill_vbos_mesh(), and update_normals_mesh().
|
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 62 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().