Blender  V3.3
Classes | Typedefs | Enumerations | Functions
bmesh_edgenet.c File Reference
#include <limits.h>
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_linklist.h"
#include "BLI_mempool.h"
#include "BLI_utildefines.h"
#include "bmesh.h"
#include "bmesh_edgenet.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Classes

struct  VertNetInfo
 

Typedefs

typedef struct VertNetInfo VertNetInfo
 

Enumerations

enum  { VNINFO_FLAG_IS_MIXFACE = (1 << 0) }
 

Functions

static bool bm_edge_step_ok (BMEdge *e)
 
static int bm_edge_face (BMEdge *e)
 
static BMEdgebm_edgenet_edge_get_next (BMesh *bm, LinkNode **edge_queue, BLI_mempool *edge_queue_pool)
 
static uint bm_edgenet_path_from_pass (BMVert *v, LinkNode **v_ls, VertNetInfo *vnet_info, BLI_mempool *path_pool)
 
static bool bm_edgenet_path_check_overlap (BMVert *v1, BMVert *v2, VertNetInfo *vnet_info)
 
static BMFacebm_edgenet_face_from_path (BMesh *bm, LinkNode *path, const uint path_len)
 
static BMEdgebm_edgenet_path_step (BMVert *v_curr, LinkNode **v_ls, VertNetInfo *vnet_info, BLI_mempool *path_pool)
 
static LinkNodebm_edgenet_path_calc (BMEdge *e, const int pass_nr, const uint path_cost_max, uint *r_path_len, uint *r_path_cost, VertNetInfo *vnet_info, BLI_mempool *path_pool)
 
static LinkNodebm_edgenet_path_calc_best (BMEdge *e, int *pass_nr, uint path_cost_max, uint *r_path_len, uint *r_path_cost, VertNetInfo *vnet_info, BLI_mempool *path_pool)
 
void BM_mesh_edgenet (BMesh *bm, const bool use_edge_tag, const bool use_new_face_tag)
 

Detailed Description

Edge-net Fill.

Definition in file bmesh_edgenet.c.

Typedef Documentation

◆ VertNetInfo

typedef struct VertNetInfo VertNetInfo

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VNINFO_FLAG_IS_MIXFACE 

Definition at line 31 of file bmesh_edgenet.c.

Function Documentation

◆ bm_edge_face()

static int bm_edge_face ( BMEdge e)
static

Definition at line 43 of file bmesh_edgenet.c.

References BM_elem_index_get, and e.

Referenced by bm_edgenet_path_calc(), and bm_edgenet_path_step().

◆ bm_edge_step_ok()

static bool bm_edge_step_ok ( BMEdge e)
static

Check if this edge can be used in a path.

Definition at line 38 of file bmesh_edgenet.c.

References BM_elem_flag_test, BM_ELEM_TAG, e, ELEM, and NULL.

Referenced by bm_edgenet_edge_get_next(), bm_edgenet_path_calc(), bm_edgenet_path_step(), and BM_mesh_edgenet().

◆ bm_edgenet_edge_get_next()

static BMEdge* bm_edgenet_edge_get_next ( BMesh bm,
LinkNode **  edge_queue,
BLI_mempool edge_queue_pool 
)
static

Get the next available edge we can use to attempt to calculate a path from.

Definition at line 51 of file bmesh_edgenet.c.

References BLI_linklist_pop_pool(), bm, bm_edge_step_ok(), BM_EDGES_OF_MESH, BM_ITER_MESH, e, and NULL.

Referenced by BM_mesh_edgenet().

◆ bm_edgenet_face_from_path()

static BMFace* bm_edgenet_face_from_path ( BMesh bm,
LinkNode path,
const uint  path_len 
)
static

◆ bm_edgenet_path_calc()

static LinkNode* bm_edgenet_path_calc ( BMEdge e,
const int  pass_nr,
const uint  path_cost_max,
uint r_path_len,
uint r_path_cost,
VertNetInfo vnet_info,
BLI_mempool path_pool 
)
static

◆ bm_edgenet_path_calc_best()

static LinkNode* bm_edgenet_path_calc_best ( BMEdge e,
int *  pass_nr,
uint  path_cost_max,
uint r_path_len,
uint r_path_cost,
VertNetInfo vnet_info,
BLI_mempool path_pool 
)
static

Wrapper for bm_edgenet_path_calc which ensures all included edges don't have a better option.

Definition at line 347 of file bmesh_edgenet.c.

References BLI_array_alloca, BLI_assert, BLI_linklist_free_pool(), BM_edge_exists(), bm_edgenet_path_calc(), e, LinkNode::link, LinkNode::next, and NULL.

Referenced by BM_mesh_edgenet().

◆ bm_edgenet_path_check_overlap()

static bool bm_edgenet_path_check_overlap ( BMVert v1,
BMVert v2,
VertNetInfo vnet_info 
)
static

Specialized wrapper for BM_face_exists_overlap_subset that gets the verts from a path before we allocate it in the correct order.

Definition at line 103 of file bmesh_edgenet.c.

References BLI_array_alloca, BLI_linklist_prepend_alloca, BM_elem_index_get, BM_face_exists_overlap_subset(), LinkNode::link, LinkNode::next, NULL, v, v1, v2, and vn.

Referenced by bm_edgenet_path_step().

◆ bm_edgenet_path_from_pass()

static uint bm_edgenet_path_from_pass ( BMVert v,
LinkNode **  v_ls,
VertNetInfo vnet_info,
BLI_mempool path_pool 
)
static

Edge loops are built up using links to the 'prev' member. with each side of the loop having its own pass (negated from the other).

This function returns half a loop, the caller needs to run twice to get both sides.

Definition at line 80 of file bmesh_edgenet.c.

References BLI_linklist_prepend_pool(), BM_elem_index_get, v, and vn.

Referenced by bm_edgenet_path_calc().

◆ bm_edgenet_path_step()

static BMEdge* bm_edgenet_path_step ( BMVert v_curr,
LinkNode **  v_ls,
VertNetInfo vnet_info,
BLI_mempool path_pool 
)
static

Step along the path from v_curr to any vert not already in the path.

Returns
The connecting edge if the path is found, otherwise NULL.

Definition at line 173 of file bmesh_edgenet.c.

References BLI_linklist_pop_pool(), BLI_linklist_prepend_pool(), bm_edge_face(), BM_edge_other_vert(), bm_edge_step_ok(), bm_edgenet_path_check_overlap(), BM_EDGES_OF_VERT, BM_elem_index_get, BM_ITER_ELEM, e, VertNetInfo::face, VertNetInfo::flag, NULL, VertNetInfo::pass, VertNetInfo::prev, and VNINFO_FLAG_IS_MIXFACE.

Referenced by bm_edgenet_path_calc().

◆ BM_mesh_edgenet()

void BM_mesh_edgenet ( BMesh bm,
bool  use_edge_tag,
bool  use_new_face_tag 
)