27 const short check_flag,
38 if (e_rotate !=
nullptr) {
69 if (e_iter_index != -1) {
76 }
while ((l_iter = l_iter->
next) != l_radial_iter);
77 }
while ((l_radial_iter = l_radial_iter->
radial_next) !=
e->l);
86 BMesh *
bm,
BMOperator *op,
short check_flag,
const bool use_ccw,
const int edges_len)
90 MEM_mallocN(
sizeof(*eheap_table) * edges_len, __func__));
94 int edges_len_rotate = 0;
108 for (
int i = 0; i < edges_len; i++) {
111 eheap_table[i] =
nullptr;
117 PASS_TYPE_BOUNDARY = 0,
121 uint pass_type = PASS_TYPE_BOUNDARY;
123 while ((pass_type != PASS_TYPE_DONE) && (edges_len_rotate != edges_len)) {
126 for (
int i = 0; i < edges_len; i++) {
127 if (eheap_table[i] == edge_free_id) {
137 if (pass_type == PASS_TYPE_BOUNDARY) {
144 if (pass_type == PASS_TYPE_BOUNDARY) {
157 cost = cost != 0.0f ? -1.0f / cost :
FLT_MAX;
169 const int edges_len_rotate_prev = edges_len_rotate;
173 eheap_table[e_best_index] =
nullptr;
178 if (e_rotate !=
nullptr) {
184 eheap_table[e_best_index] = edge_free_id;
186 edges_len_rotate += 1;
196 BMLoop *l_radial_iter = e_rotate->
l;
203 if ((e_iter_index != -1) && (eheap_table[e_iter_index] ==
nullptr)) {
205 BLI_assert((eheap_table[e_iter_index] != edge_free_id));
212 }
while ((l_iter = l_iter->
next) != l_radial_iter);
213 }
while ((l_radial_iter = l_radial_iter->
radial_next) != e_rotate->
l);
219 if (edges_len_rotate == edges_len_rotate_prev) {
235 const bool is_single = (edges_len == 1);
239 bool is_simple =
true;
240 if (is_single ==
false) {
251 if (is_simple ==
false) {
A min-heap / priority queue ADT.
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1)
Heap * BLI_heap_new_ex(unsigned int reserve_num) ATTR_WARN_UNUSED_RESULT
void void bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1)
void * BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1)
HeapNode * BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL(1)
Read Guarded memory(de)allocation.
#define BM_elem_index_get(ele)
#define BM_elem_index_set(ele, index)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
bool BM_edge_rotate_check(BMEdge *e)
Check if Rotate Edge is OK.
BMEdge * BM_edge_rotate(BMesh *bm, BMEdge *e, const bool ccw, const short check_flag)
Rotate Edge.
@ BM_EDGEROT_CHECK_EXISTS
@ BM_EDGEROT_CHECK_DEGENERATE
#define BMO_edge_flag_enable(bm, e, oflag)
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
#define BMO_SLOT_AS_BUFFER(slot)
void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
#define BMO_face_flag_enable(bm, e, oflag)
#define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag)
int BMO_slot_buffer_len(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
#define BMO_face_flag_test(bm, e, oflag)
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
float BM_edge_calc_length_squared(const BMEdge *e)
bool BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
static float bm_edge_calc_rotate_cost(const BMEdge *e)
static void bm_rotate_edges_shared(BMesh *bm, BMOperator *op, short check_flag, const bool use_ccw, const int edges_len)
static void bm_rotate_edges_simple(BMesh *bm, BMOperator *op, const short check_flag, const bool use_ccw)
void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op)
static float bm_edge_rotate_is_boundary(const BMEdge *e)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
_W64 unsigned int uintptr_t
struct BMLoop * radial_next
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]