Blender V4.3
bmesh_edgenet.cc File Reference
#include <climits>
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_linklist.h"
#include "BLI_mempool.h"
#include "BLI_utildefines.h"
#include "bmesh.hh"
#include "bmesh_edgenet.hh"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Classes

struct  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.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VNINFO_FLAG_IS_MIXFACE 

Definition at line 33 of file bmesh_edgenet.cc.

Function Documentation

◆ bm_edge_face()

static int bm_edge_face ( BMEdge * e)
static

Definition at line 45 of file bmesh_edgenet.cc.

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 40 of file bmesh_edgenet.cc.

References BM_elem_flag_test, BM_ELEM_TAG, e, and ELEM.

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 53 of file bmesh_edgenet.cc.

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

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 351 of file bmesh_edgenet.cc.

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

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 105 of file bmesh_edgenet.cc.

References BLI_array_alloca, BLI_linklist_prepend_alloca, BM_elem_index_get, BM_face_exists_overlap_subset(), LinkNode::link, LinkNode::next, VertNetInfo::pass, VertNetInfo::prev, v, and v2.

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 82 of file bmesh_edgenet.cc.

References BLI_linklist_prepend_pool(), BM_elem_index_get, VertNetInfo::pass, VertNetInfo::prev, and v.

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 nullptr.

Definition at line 175 of file bmesh_edgenet.cc.

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_edgenet_path_step(), BM_EDGES_OF_VERT, BM_elem_index_get, BM_ITER_ELEM, e, VertNetInfo::face, VertNetInfo::flag, VertNetInfo::pass, VertNetInfo::prev, and VNINFO_FLAG_IS_MIXFACE.

Referenced by bm_edgenet_path_calc(), and bm_edgenet_path_step().

◆ BM_mesh_edgenet()

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