Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_utildefines_stack.h"
#include "BKE_curve.h"
#include "bmesh.h"
#include "intern/bmesh_operators_private.h"
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) |
Typedefs | |
typedef struct LoopPairStore | LoopPairStore |
This operator is a special edge-ring subdivision tool which gives special options for interpolation.
Definition in file bmo_subdivide_edgering.c.
#define EDGE_IN_STACK (1 << 2) |
Definition at line 38 of file bmo_subdivide_edgering.c.
#define EDGE_RIM (1 << 1) |
Definition at line 37 of file bmo_subdivide_edgering.c.
#define EDGE_RING (1 << 0) |
Definition at line 36 of file bmo_subdivide_edgering.c.
#define FACE_IN_STACK (1 << 2) |
Definition at line 42 of file bmo_subdivide_edgering.c.
#define FACE_OUT (1 << 0) |
Definition at line 40 of file bmo_subdivide_edgering.c.
#define FACE_SHARED (1 << 1) |
Definition at line 41 of file bmo_subdivide_edgering.c.
#define VERT_SHARED (1 << 0) |
Definition at line 34 of file bmo_subdivide_edgering.c.
typedef struct LoopPairStore LoopPairStore |
Store data for each loop pair, needed so we don't get feedback loop reading/writing the mesh data.
currently only used to store vert-spline-handles, but may be extended for other uses.
|
static |
Definition at line 62 of file bmo_subdivide_edgering.c.
References add_v3_v3(), closest_to_line_v3(), copy_v3_v3(), cross_v3_v3v3(), blender::math::dot(), dot_v3v3(), len, len_squared_v3(), len_v3v3(), and t.
Referenced by bm_edgering_pair_interpolate().
Definition at line 1044 of file bmo_subdivide_edgering.c.
References bm, BMO_edge_flag_test_bool, e, and EDGE_RIM.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 264 of file bmo_subdivide_edgering.c.
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 150 of file bmo_subdivide_edgering.c.
References bm, bm_edgeloop_vert_tag(), BM_edgeloop_verts_get(), bm_vert_is_tag_edge_connect(), ListBase::first, and node.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 99 of file bmo_subdivide_edgering.c.
References BM_edgeloop_verts_get(), BM_elem_flag_set, BM_ELEM_TAG, ListBase::first, and node.
Referenced by bm_edgeloop_check_overlap_all(), bm_edgering_pair_order(), and bm_edgering_pair_subdiv().
Method for finding pairs:
Definition at line 189 of file bmo_subdivide_edgering.c.
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, data, e, EDGE_RING, GHashPair::first, ListBase::first, node, NULL, GHashPair::second, SWAP, and v.
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 516 of file bmo_subdivide_edgering.c.
References add_v3_v3(), angle(), 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, BMEdgeLoopStore::no, normalize_qt(), normalize_v3_v3(), LoopPairStore::nors_a, LoopPairStore::nors_b, LoopPairStore::nors_gh_a, LoopPairStore::nors_gh_b, NULL, 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(), void, 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 868 of file bmo_subdivide_edgering.c.
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, e, EDGE_RING, ListBase::first, node, and NULL.
Referenced by bm_edgering_pair_ringsubd().
|
static |
Definition at line 830 of file bmo_subdivide_edgering.c.
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 1027 of file bmo_subdivide_edgering.c.
References bm, bm_edgering_pair_interpolate(), bm_edgering_pair_order(), bm_edgering_pair_subdiv(), BM_mesh_edgeloops_free(), NULL, and smooth().
Referenced by bmo_subdivide_edgering_exec().
|
static |
Definition at line 427 of file bmo_subdivide_edgering.c.
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 501 of file bmo_subdivide_edgering.c.
References BLI_ghash_free(), MEM_freeN, LoopPairStore::nors_a, LoopPairStore::nors_b, LoopPairStore::nors_gh_a, LoopPairStore::nors_gh_b, NULL, 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 937 of file bmo_subdivide_edgering.c.
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, BMLoop::e, e, EDGE_IN_STACK, EDGE_RIM, EDGE_RING, FACE_IN_STACK, FACE_OUT, ListBase::first, max_ii(), BMLoop::next, node, 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 808 of file bmo_subdivide_edgering.c.
References bm, BM_face_split(), BMO_face_flag_enable, BMLoop::f, FACE_OUT, l, BMFace::len, BMLoop::next, NULL, 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 394 of file bmo_subdivide_edgering.c.
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 372 of file bmo_subdivide_edgering.c.
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 306 of file bmo_subdivide_edgering.c.
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(), BMEdgeLoopStore::no, normalize_v3(), normalize_v3_v3(), UNLIKELY, and v.
Referenced by bm_edgering_pair_interpolate(), and bm_edgering_pair_store_create().
Definition at line 130 of file bmo_subdivide_edgering.c.
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 48 of file bmo_subdivide_edgering.c.
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 107 of file bmo_subdivide_edgering.c.
References bm, BM_edgeloop_verts_get(), BMO_vert_flag_set, ListBase::first, node, and oflag.
Referenced by bm_edgering_pair_store_create().
Definition at line 118 of file bmo_subdivide_edgering.c.
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 1050 of file bmo_subdivide_edgering.c.
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, NULL, GHashPair::second, BMOperator::slots_in, BMOperator::slots_out, and smooth().