Blender V4.3
bmesh_mesh_partial_update.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_bitmap.h"
#include "bmesh.hh"

Go to the source code of this file.

Macros

#define GROW(len_alloc)   ((len_alloc) + ((len_alloc) - ((len_alloc) / 2)))
 
#define GROW_ARRAY(mem, len_alloc)
 
#define GROW_ARRAY_AS_NEEDED(mem, len_alloc, index)
 

Functions

BLI_INLINE bool partial_elem_vert_ensure (BMPartialUpdate *bmpinfo, BLI_bitmap *verts_tag, BMVert *v)
 
BLI_INLINE bool partial_elem_face_ensure (BMPartialUpdate *bmpinfo, BLI_bitmap *faces_tag, BMFace *f)
 
BMPartialUpdateBM_mesh_partial_create_from_verts (BMesh *bm, const BMPartialUpdate_Params *params, const BLI_bitmap *verts_mask, const int verts_mask_count)
 
BMPartialUpdateBM_mesh_partial_create_from_verts_group_single (BMesh *bm, const BMPartialUpdate_Params *params, const BLI_bitmap *verts_mask, const int verts_mask_count)
 
BMPartialUpdateBM_mesh_partial_create_from_verts_group_multi (BMesh *bm, const BMPartialUpdate_Params *params, const int *verts_group, const int verts_group_count)
 
void BM_mesh_partial_destroy (BMPartialUpdate *bmpinfo)
 

Detailed Description

Generate data needed for partially updating mesh information. Currently this is used for normals and tessellation.

Transform is the obvious use case where there is no need to update normals or tessellation for geometry which has not been modified.

In the future this could be integrated into GPU updates too.

Kinds of Partial Geometry

All Tagged

Operate on everything that's tagged as well as connected geometry. see: BM_mesh_partial_create_from_verts

Grouped

Operate on everything that is connected to both tagged and un-tagged. see: BM_mesh_partial_create_from_verts_group_single

Reduces computations when transforming isolated regions.

Optionally support multiple groups since axis-mirror (for example) will transform vertices in different directions, as well as keeping centered vertices. see: BM_mesh_partial_create_from_verts_group_multi

Note
Others can be added as needed.

Definition in file bmesh_mesh_partial_update.cc.

Macro Definition Documentation

◆ GROW

#define GROW ( len_alloc)    ((len_alloc) + ((len_alloc) - ((len_alloc) / 2)))

Grow by 1.5x (rounding up).

Note
Use conservative reallocation since the initial sizes reserved may be close to (or exactly) the number of elements needed.

Definition at line 50 of file bmesh_mesh_partial_update.cc.

◆ GROW_ARRAY

#define GROW_ARRAY ( mem,
len_alloc )
Value:
{ \
*(void **)&mem = MEM_reallocN(mem, sizeof(*mem) * ((len_alloc) = GROW(len_alloc))); \
} \
((void)0)
#define MEM_reallocN(vmemh, len)
#define GROW(len_alloc)
uint len_alloc

Definition at line 51 of file bmesh_mesh_partial_update.cc.

◆ GROW_ARRAY_AS_NEEDED

#define GROW_ARRAY_AS_NEEDED ( mem,
len_alloc,
index )
Value:
if (UNLIKELY(len_alloc == index)) { \
GROW_ARRAY(mem, len_alloc); \
}
#define UNLIKELY(x)

Definition at line 57 of file bmesh_mesh_partial_update.cc.

Referenced by partial_elem_face_ensure(), and partial_elem_vert_ensure().

Function Documentation

◆ BM_mesh_partial_create_from_verts()

◆ BM_mesh_partial_create_from_verts_group_multi()

◆ BM_mesh_partial_create_from_verts_group_single()

◆ BM_mesh_partial_destroy()

void BM_mesh_partial_destroy ( BMPartialUpdate * bmpinfo)

◆ partial_elem_face_ensure()

◆ partial_elem_vert_ensure()