Blender  V3.3
Macros | Functions
bmesh_mesh_partial_update.c File Reference
#include "DNA_object_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_bitmap.h"
#include "BLI_math_vector.h"
#include "bmesh.h"

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

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 52 of file bmesh_mesh_partial_update.c.

◆ GROW_ARRAY

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

Definition at line 53 of file bmesh_mesh_partial_update.c.

◆ 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 59 of file bmesh_mesh_partial_update.c.

Function Documentation

◆ BM_mesh_partial_create_from_verts()

BMPartialUpdate* BM_mesh_partial_create_from_verts ( BMesh bm,
const BMPartialUpdate_Params params,
const BLI_bitmap verts_mask,
const int  verts_mask_count 
)

◆ BM_mesh_partial_create_from_verts_group_multi()

BMPartialUpdate* BM_mesh_partial_create_from_verts_group_multi ( BMesh bm,
const BMPartialUpdate_Params params,
const int *  verts_group,
const int  verts_group_count 
)

◆ BM_mesh_partial_create_from_verts_group_single()

BMPartialUpdate* BM_mesh_partial_create_from_verts_group_single ( BMesh bm,
const BMPartialUpdate_Params params,
const BLI_bitmap verts_mask,
const int  verts_mask_count 
)

◆ BM_mesh_partial_destroy()

void BM_mesh_partial_destroy ( BMPartialUpdate bmpinfo)

◆ partial_elem_face_ensure()

BLI_INLINE bool partial_elem_face_ensure ( BMPartialUpdate bmpinfo,
BLI_bitmap faces_tag,
BMFace f 
)

◆ partial_elem_vert_ensure()

BLI_INLINE bool partial_elem_vert_ensure ( BMPartialUpdate bmpinfo,
BLI_bitmap verts_tag,
BMVert v 
)