Blender V5.0
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()

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()

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()

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()

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

◆ bm_edgenet_path_calc()

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()

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, i, LinkNode::link, and LinkNode::next.

Referenced by BM_mesh_edgenet().

◆ bm_edgenet_path_check_overlap()

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(), i, LinkNode::link, LinkNode::next, VertNetInfo::pass, VertNetInfo::prev, v, and v2.

Referenced by bm_edgenet_path_step().

◆ bm_edgenet_path_from_pass()

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()

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

◆ BM_mesh_edgenet()

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

Fill in faces from an edgenet made up of boundary and wire edges.

Note
New faces currently don't have their normals calculated and are flipped randomly. The caller needs to flip faces correctly.
Parameters
bmThe mesh to operate on.
use_edge_tagOnly fill tagged edges.

Definition at line 415 of file bmesh_edgenet.cc.

References BLI_assert, BLI_linklist_free_pool(), BLI_linklist_prepend_pool(), BLI_mempool_create(), BLI_mempool_destroy(), BLI_mempool_len(), BLI_MEMPOOL_NOP, bm, bm_edge_step_ok(), bm_edgenet_edge_get_next(), bm_edgenet_face_from_path(), bm_edgenet_path_calc_best(), BM_EDGES_OF_MESH, BM_elem_flag_enable, BM_elem_flag_set, BM_elem_index_set, BM_ELEM_TAG, BM_FACE, BM_FACE_FIRST_LOOP, BM_ITER_MESH, BM_LOOP, BM_mesh_elem_index_ensure(), BM_VERT, BMLoop::e, e, MEM_calloc_arrayN(), MEM_freeN(), BMLoop::next, and UINT_MAX.

Referenced by BKE_mesh_remesh_voxel_fix_poles(), bmo_edgenet_fill_exec(), bmo_holes_fill_exec(), and slice_paint_mask().