|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "BLI_alloca.h"#include "BLI_listbase.h"#include "BLI_math_geom.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_utildefines.h"#include "BLI_utildefines_stack.h"#include "BKE_curve.hh"#include "bmesh.hh"#include "intern/bmesh_operators_private.hh"Go to the source code of this file.
Classes | |
| struct | LoopPairStore |
Macros | |
| #define | VERT_SHARED (1 << 0) |
| #define | EDGE_RING (1 << 0) |
| #define | EDGE_RIM (1 << 1) |
| #define | EDGE_IN_STACK (1 << 2) |
| #define | FACE_OUT (1 << 0) |
| #define | FACE_SHARED (1 << 1) |
| #define | FACE_IN_STACK (1 << 2) |
Functions | |
Specialized Utility Functions | |
| static uint | bm_verts_tag_count (BMesh *bm) |
| static float | bezier_handle_calc_length_v3 (const float co_a[3], const float no_a[3], const float co_b[3], const float no_b[3]) |
| static void | bm_edgeloop_vert_tag (BMEdgeLoopStore *el_store, const bool tag) |
| static void | bmo_edgeloop_vert_tag (BMesh *bm, BMEdgeLoopStore *el_store, const short oflag, const bool tag) |
| static bool | bmo_face_is_vert_tag_all (BMesh *bm, BMFace *f, short oflag) |
| static bool | bm_vert_is_tag_edge_connect (BMesh *bm, BMVert *v) |
| static bool | bm_edgeloop_check_overlap_all (BMesh *bm, BMEdgeLoopStore *el_store_a, BMEdgeLoopStore *el_store_b) |
Edge Loop Pairs | |
key (ordered loop pointers). | |
| static GSet * | bm_edgering_pair_calc (BMesh *bm, ListBase *eloops_rim) |
Subdivide an edge 'n' times and return an open edgeloop | |
| static void | bm_edge_subdiv_as_loop (BMesh *bm, ListBase *eloops, BMEdge *e, BMVert *v_a, const int cuts) |
Loop Pair Cache (struct and utilities functions) | |
| static void | bm_vert_calc_surface_tangent (BMesh *bm, BMVert *v, float r_no[3]) |
| static void | bm_faces_share_tag_flush (BMesh *bm, BMEdge **e_arr, const uint e_arr_len) |
| static void | bm_faces_share_tag_clear (BMesh *bm, BMEdge **e_arr_iter, const uint e_arr_len_iter) |
| static LoopPairStore * | bm_edgering_pair_store_create (BMesh *bm, BMEdgeLoopStore *el_store_a, BMEdgeLoopStore *el_store_b, const int interp_mode) |
| static void | bm_edgering_pair_store_free (LoopPairStore *lpair, const int interp_mode) |
Interpolation Function | |
| static void | bm_edgering_pair_interpolate (BMesh *bm, LoopPairStore *lpair, BMEdgeLoopStore *el_store_a, BMEdgeLoopStore *el_store_b, ListBase *eloops_ring, const int interp_mode, const int cuts, const float smooth, const float *falloff_cache) |
| static void | bm_face_slice (BMesh *bm, BMLoop *l, const int cuts) |
| static bool | bm_edgering_pair_order_is_flipped (BMesh *, BMEdgeLoopStore *el_store_a, BMEdgeLoopStore *el_store_b) |
| static void | bm_edgering_pair_order (BMesh *bm, BMEdgeLoopStore *el_store_a, BMEdgeLoopStore *el_store_b) |
| static void | bm_edgering_pair_subdiv (BMesh *bm, BMEdgeLoopStore *el_store_a, BMEdgeLoopStore *el_store_b, ListBase *eloops_ring, const int cuts) |
| static void | bm_edgering_pair_ringsubd (BMesh *bm, LoopPairStore *lpair, BMEdgeLoopStore *el_store_a, BMEdgeLoopStore *el_store_b, const int interp_mode, const int cuts, const float smooth, const float *falloff_cache) |
| static bool | bm_edge_rim_test_cb (BMEdge *e, void *bm_v) |
| void | bmo_subdivide_edgering_exec (BMesh *bm, BMOperator *op) |
This operator is a special edge-ring subdivision tool which gives special options for interpolation.
Definition in file bmo_subdivide_edgering.cc.
| #define EDGE_IN_STACK (1 << 2) |
Definition at line 42 of file bmo_subdivide_edgering.cc.
Referenced by bm_edgering_pair_subdiv().
| #define EDGE_RIM (1 << 1) |
Definition at line 41 of file bmo_subdivide_edgering.cc.
Referenced by bm_edge_rim_test_cb(), bm_edgering_pair_subdiv(), bm_vert_calc_surface_tangent(), and bmo_subdivide_edgering_exec().
| #define EDGE_RING (1 << 0) |
Definition at line 40 of file bmo_subdivide_edgering.cc.
Referenced by bm_edgering_pair_calc(), bm_edgering_pair_order(), bm_edgering_pair_subdiv(), bm_vert_is_tag_edge_connect(), and bmo_subdivide_edgering_exec().
| #define FACE_IN_STACK (1 << 2) |
Definition at line 46 of file bmo_subdivide_edgering.cc.
Referenced by bm_edgering_pair_subdiv().
| #define FACE_OUT (1 << 0) |
Definition at line 44 of file bmo_subdivide_edgering.cc.
Referenced by bm_edgering_pair_subdiv(), bm_face_slice(), bm_vert_calc_surface_tangent(), and bmo_subdivide_edgering_exec().
| #define FACE_SHARED (1 << 1) |
Definition at line 45 of file bmo_subdivide_edgering.cc.
Referenced by bm_faces_share_tag_clear(), bm_faces_share_tag_flush(), and bm_vert_calc_surface_tangent().
| #define VERT_SHARED (1 << 0) |
Definition at line 38 of file bmo_subdivide_edgering.cc.
Referenced by bm_edgering_pair_store_create(), and bm_faces_share_tag_flush().
|
static |
Definition at line 67 of file bmo_subdivide_edgering.cc.
References add_v3_v3(), closest_to_line_v3(), copy_v3_v3(), cross_v3_v3v3(), dot(), dot_v3v3(), len, len_squared_v3(), and len_v3v3().
Referenced by bm_edgering_pair_interpolate().
|
static |
Definition at line 1089 of file bmo_subdivide_edgering.cc.
References bm, BMO_edge_flag_test_bool, e, and EDGE_RIM.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 278 of file bmo_subdivide_edgering.cc.
References BLI_addtail(), BLI_array_alloca, BLI_assert, bm, BM_edge_other_vert(), BM_edge_split_n(), BM_edgeloop_flip(), BM_edgeloop_from_verts(), BM_vert_in_edge(), and e.
Referenced by bm_edgering_pair_subdiv().
|
static |
Definition at line 155 of file bmo_subdivide_edgering.cc.
References bm, bm_edgeloop_vert_tag(), BM_edgeloop_verts_get(), bm_vert_is_tag_edge_connect(), and LISTBASE_FOREACH.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 104 of file bmo_subdivide_edgering.cc.
References BM_edgeloop_verts_get(), BM_elem_flag_set, BM_ELEM_TAG, and ListBase::first.
Referenced by bm_edgeloop_check_overlap_all(), bm_edgering_pair_order(), and bm_edgering_pair_subdiv().
Method for finding pairs:
Definition at line 196 of file bmo_subdivide_edgering.cc.
References BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_ptr_new(), BLI_ghashutil_pairalloc(), BLI_gset_ensure_p_ex(), BLI_gset_free(), BLI_gset_len(), BLI_gset_pair_new(), bm, BM_edge_other_vert(), BM_EDGELOOP_NEXT, BM_edgeloop_verts_get(), BM_EDGES_OF_VERT, BM_ITER_ELEM, BMO_edge_flag_test, e, EDGE_RING, GHashPair::first, ListBase::first, GHashPair::second, and v.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 539 of file bmo_subdivide_edgering.cc.
References add_v3_v3(), angle_normalized_v3v3(), axis_angle_to_quat(), bezier_handle_calc_length_v3(), bisect_v3_v3v3v3(), BKE_curve_forward_diff_bezier(), BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm, BM_edgeloop_calc_center(), BM_edgeloop_calc_normal(), BM_edgeloop_calc_normal_aligned(), BM_edgeloop_center_get(), BM_EDGELOOP_NEXT, BM_edgeloop_normal_get(), BM_edgeloop_verts_get(), bm_vert_calc_surface_tangent(), BMVert::co, copy_qt_qt(), copy_v3_v3(), cross_v3_v3v3(), LinkData::data, dot_v3v3(), ListBase::first, float, interp_v3_v3v3(), ListBase::last, MEM_freeN(), MEM_mallocN, mul_qt_qtqt(), mul_qt_v3(), mul_v3_v3fl(), negate_v3(), negate_v3_v3(), LinkData::next, next, normalize_qt(), normalize_v3_v3(), LoopPairStore::nors_a, LoopPairStore::nors_b, LoopPairStore::nors_gh_a, LoopPairStore::nors_gh_b, POINTER_AS_UINT, smooth(), sub_v3_v3v3(), SUBD_RING_INTERP_LINEAR, SUBD_RING_INTERP_PATH, SUBD_RING_INTERP_SURF, transform_point_by_tri_v3(), UNPACK3, vec_to_quat(), and zero_v3().
Referenced by bm_edgering_pair_ringsubd().
|
static |
Takes 2 edge loops that share edges, sort their verts and rotates the list so the lined up.
Definition at line 912 of file bmo_subdivide_edgering.cc.
References BLI_assert, BLI_listbase_rotate_first(), bm, BM_edge_exists(), BM_edge_other_vert(), BM_edgeloop_flip(), BM_edgeloop_is_closed(), bm_edgeloop_vert_tag(), BM_edgeloop_verts_get(), bm_edgering_pair_order_is_flipped(), BM_EDGES_OF_VERT, BM_elem_flag_test, BM_ELEM_TAG, BM_ITER_ELEM, BMO_edge_flag_test, BMIter::data, e, EDGE_RING, ListBase::first, and node.
Referenced by bm_edgering_pair_ringsubd().
|
static |
Definition at line 866 of file bmo_subdivide_edgering.cc.
References BLI_assert, BM_edge_exists(), BM_edgeloop_verts_get(), LinkData::data, ListBase::first, ListBase::last, LinkData::next, and LinkData::prev.
Referenced by bm_edgering_pair_order().
|
static |
Definition at line 1072 of file bmo_subdivide_edgering.cc.
References bm, bm_edgering_pair_interpolate(), bm_edgering_pair_order(), bm_edgering_pair_subdiv(), and BM_mesh_edgeloops_free().
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 444 of file bmo_subdivide_edgering.cc.
References BLI_array_alloca, BLI_ghash_insert(), BLI_ghash_ptr_new(), bm, BM_edgeloop_edges_get(), BM_edgeloop_is_closed(), BM_edgeloop_length_get(), BM_edgeloop_verts_get(), bm_faces_share_tag_clear(), bm_faces_share_tag_flush(), bm_vert_calc_surface_tangent(), bmo_edgeloop_vert_tag(), LinkData::data, ListBase::first, float, MEM_mallocN, LinkData::next, nor, LoopPairStore::nors_a, LoopPairStore::nors_b, LoopPairStore::nors_gh_a, LoopPairStore::nors_gh_b, POINTER_FROM_UINT, SUBD_RING_INTERP_SURF, v, and VERT_SHARED.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 521 of file bmo_subdivide_edgering.cc.
References BLI_ghash_free(), MEM_freeN(), LoopPairStore::nors_a, LoopPairStore::nors_b, LoopPairStore::nors_gh_a, LoopPairStore::nors_gh_b, and SUBD_RING_INTERP_SURF.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Take 2 edge loops, do a subdivision on connecting edges.
Definition at line 982 of file bmo_subdivide_edgering.cc.
References BLI_array_alloca, bm, BM_edge_other_vert(), bm_edge_subdiv_as_loop(), BM_edgeloop_length_get(), BM_EDGELOOP_NEXT, bm_edgeloop_vert_tag(), BM_edgeloop_verts_get(), BM_EDGES_OF_VERT, BM_elem_flag_test, BM_ELEM_TAG, BM_FACE_FIRST_LOOP, bm_face_slice(), BM_FACES_OF_EDGE, BM_ITER_ELEM, BMO_edge_flag_disable, BMO_edge_flag_enable, BMO_edge_flag_test, BMO_face_flag_disable, BMO_face_flag_enable, BMO_face_flag_test, BMIter::data, BMLoop::e, e, EDGE_IN_STACK, EDGE_RIM, EDGE_RING, FACE_IN_STACK, FACE_OUT, ListBase::first, LISTBASE_FOREACH, max_ii(), BMLoop::next, STACK_DECLARE, STACK_INIT, STACK_POP, and STACK_PUSH.
Referenced by bm_edgering_pair_ringsubd().
Cuts up an ngon into many slices.
Definition at line 844 of file bmo_subdivide_edgering.cc.
References bm, BM_face_split(), BMO_face_flag_enable, BMLoop::f, FACE_OUT, l, BMFace::len, BMLoop::next, BMLoop::prev, and BMLoop::radial_next.
Referenced by bm_edgering_pair_subdiv().
|
static |
Un-Tag faces connected to an edge loop, clearing FACE_SHARED
Definition at line 411 of file bmo_subdivide_edgering.cc.
References bm, BMO_face_flag_disable, e, BMLoop::f, FACE_SHARED, and BMLoop::radial_next.
Referenced by bm_edgering_pair_store_create().
Tag faces connected to an edge loop as FACE_SHARED if all vertices are VERT_SHARED.
Definition at line 389 of file bmo_subdivide_edgering.cc.
References bm, BMO_face_flag_enable, BMO_face_flag_test, bmo_face_is_vert_tag_all(), e, BMLoop::f, FACE_SHARED, BMLoop::radial_next, and VERT_SHARED.
Referenced by bm_edgering_pair_store_create().
Use for finding spline handle direction from surrounding faces.
Resulting normal will always point towards 'FACE_SHARED'
This function must be called after all loops have been created, but before any mesh modifications.
Definition at line 323 of file bmo_subdivide_edgering.cc.
References add_v3_v3(), add_v3_v3v3(), BLI_assert, bm, BM_edge_calc_face_tangent(), BM_edge_is_wire(), BM_EDGES_OF_VERT, BM_ITER_ELEM, BM_LOOPS_OF_EDGE, BMO_edge_flag_test, BMO_face_flag_test, e, EDGE_RIM, BMLoop::f, FACE_OUT, FACE_SHARED, l, negate_v3(), normalize_v3(), normalize_v3_v3(), UNLIKELY, and v.
Referenced by bm_edgering_pair_interpolate(), and bm_edgering_pair_store_create().
Definition at line 135 of file bmo_subdivide_edgering.cc.
References bm, BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_flag_test, BM_ELEM_TAG, BM_ITER_ELEM, BMO_edge_flag_test, e, EDGE_RING, and v.
Referenced by bm_edgeloop_check_overlap_all().
Definition at line 53 of file bmo_subdivide_edgering.cc.
References bm, BM_elem_flag_test, BM_ELEM_TAG, BM_ITER_MESH, BM_VERTS_OF_MESH, count, and v.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 112 of file bmo_subdivide_edgering.cc.
References bm, BM_edgeloop_verts_get(), BMO_vert_flag_set, ListBase::first, and oflag.
Referenced by bm_edgering_pair_store_create().
Definition at line 123 of file bmo_subdivide_edgering.cc.
References bm, BM_FACE_FIRST_LOOP, BMO_vert_flag_test, BMLoop::next, oflag, and BMLoop::v.
Referenced by bm_faces_share_tag_flush().
| void bmo_subdivide_edgering_exec | ( | BMesh * | bm, |
| BMOperator * | op ) |
Definition at line 1095 of file bmo_subdivide_edgering.cc.
References BLI_array_alloca, BLI_assert, BLI_gset_free(), BLI_gset_len(), BLI_gsetIterator_getKey(), bm, BM_EDGE, bm_edge_rim_test_cb(), bm_edgeloop_check_overlap_all(), bm_edgering_pair_calc(), bm_edgering_pair_ringsubd(), bm_edgering_pair_store_create(), bm_edgering_pair_store_free(), BM_ELEM_TAG, BM_FACE, BM_FACES_OF_EDGE, BM_ITER_ELEM, BM_LOOPS_OF_FACE, BM_mesh_edgeloops_find(), BM_mesh_edgeloops_free(), BM_mesh_elem_hflag_disable_all(), BM_VERT, bm_verts_tag_count(), bmesh_subd_falloff_calc(), BMO_edge_flag_enable, BMO_edge_flag_test, BMO_ERROR_CANCEL, BMO_error_raise(), BMO_face_flag_enable, BMO_face_flag_test, BMO_ITER, BMO_slot_buffer_flag_enable(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_float_get(), BMO_slot_int_get(), count, BMLoop::e, e, EDGE_RIM, EDGE_RING, fabsf, FACE_OUT, GHashPair::first, ListBase::first, float, GSET_ITER_INDEX, l, ListBase::last, BMFace::len, MEM_freeN(), GHashPair::second, BMOperator::slots_in, and BMOperator::slots_out.