56static uint erot_gsetutil_hash(
const void *
ptr)
63static int erot_gsetutil_cmp(
const void *a,
const void *
b)
100#define EDGE_ORD(v0, v1) \
144 float no_a[3], no_b[3];
145 float angle_24, angle_13;
159 return angle_13 - angle_24;
175 const BMVert *v_a = v1, *v_b = v3;
203 v3 =
e->l->radial_next->prev->v;
215 return ((index >= 0) && (index < edge_array_len) && (
e == edge_array[index]));
222 GSet **edge_state_arr,
224 const BMEdge **edge_array,
225 const int edge_array_len,
232 GSet *e_state_set = edge_state_arr[
i];
234 if (eheap_table[
i]) {
236 eheap_table[
i] =
nullptr;
243 if (e_state_set !=
nullptr) {
259 eheap_table[
i] =
nullptr;
269 GSet **edge_state_arr,
270 const BMEdge **edge_array,
271 const int edge_array_len,
281 e->l->radial_next->next->e,
282 e->l->radial_next->prev->e,
285 BLI_assert(
e->l->f->len == 3 &&
e->l->radial_next->f->len == 3);
289 for (
i = 0;
i < 4;
i++) {
291 e_arr[
i], eheap, eheap_table, edge_state_arr, edge_array, edge_array_len,
flag, method);
300 const int edge_array_len,
303 const short oflag_edge,
304 const short oflag_face)
321 for (
i = 0;
i < edge_array_len;
i++) {
328 eheap_table[
i] =
nullptr;
338 eheap_table[
i] =
nullptr;
347 GSet *e_state_set = edge_state_arr[
i];
354 if (
UNLIKELY(e_state_set ==
nullptr)) {
371 (
const BMEdge **)edge_array,
391 for (
i = 0;
i < edge_array_len;
i++) {
392 if (edge_state_arr[
i]) {
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
#define BLI_ghashutil_inthash_v4_cmp
#define BLI_ghashutil_inthash_v4(key)
void BLI_gset_insert(GSet *gs, void *key)
GSet * BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
#define BLI_ghashutil_inthash_v4_p
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
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)
void void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
void * BLI_mempool_alloc(BLI_mempool *pool) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
BLI_mempool * BLI_mempool_create(unsigned int esize, unsigned int elem_num, unsigned int pchunk, unsigned int flag) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1)
float BLI_polyfill_edge_calc_rotate_beauty__area(const float v1[3], const float v2[3], const float v3[3], const float v4[3], bool lock_degenerate)
Platform independent time functions.
Utility defines for timing/benchmarks.
#define TIMEIT_START(var)
Read Guarded memory(de)allocation.
static void erot_state_alternate(const BMEdge *e, EdRotState *e_state)
BLI_INLINE bool edge_in_array(const BMEdge *e, const BMEdge **edge_array, const int edge_array_len)
void BM_mesh_beautify_fill(BMesh *bm, BMEdge **edge_array, const int edge_array_len, const short flag, const short method, const short oflag_edge, const short oflag_face)
float BM_verts_calc_rotate_beauty(const BMVert *v1, const BMVert *v2, const BMVert *v3, const BMVert *v4, const short flag, const short method)
static void erot_state_current(const BMEdge *e, EdRotState *e_state)
static void bm_edge_update_beauty_cost_single(BMEdge *e, Heap *eheap, HeapNode **eheap_table, GSet **edge_state_arr, const BMEdge **edge_array, const int edge_array_len, const short flag, const short method)
static float bm_edge_calc_rotate_beauty__angle(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
static void erot_state_ex(const BMEdge *e, int v_index[2], int f_index[2])
static GSet * erot_gset_new()
static void bm_edge_update_beauty_cost(BMEdge *e, Heap *eheap, HeapNode **eheap_table, GSet **edge_state_arr, const BMEdge **edge_array, const int edge_array_len, const short flag, const short method)
static float bm_edge_calc_rotate_beauty(const BMEdge *e, const short flag, const short method)
@ EDGE_RESTRICT_DEGENERATE
#define BM_elem_index_get(ele)
#define BM_elem_index_set(ele, index)
#define BM_elem_flag_test(ele, hflag)
BMEdge * BM_edge_rotate(BMesh *bm, BMEdge *e, const bool ccw, const short check_flag)
Rotate Edge.
@ BM_EDGEROT_CHECK_EXISTS
#define BMO_edge_flag_enable(bm, e, oflag)
#define BMO_face_flag_enable(bm, e, oflag)
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define BM_edge_face_count_is_equal(e, n)
BLI_INLINE bool BM_vert_in_edge(const BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)