73 switch (ele_head->
htype) {
83 #define BMO_elem_flag_test(bm, ele, oflag) \
84 _bmo_elem_flag_test(bm, BMO_elem_flag_from_header(&(ele)->head), oflag)
85 #define BMO_elem_flag_test_bool(bm, ele, oflag) \
86 _bmo_elem_flag_test_bool(bm, BMO_elem_flag_from_header(&(ele)->head), oflag)
87 #define BMO_elem_flag_enable(bm, ele, oflag) \
88 _bmo_elem_flag_enable( \
89 bm, (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), oflag)
90 #define BMO_elem_flag_disable(bm, ele, oflag) \
91 _bmo_elem_flag_disable( \
92 bm, (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), oflag)
93 #define BMO_elem_flag_set(bm, ele, oflag, val) \
94 _bmo_elem_flag_set(bm, \
95 (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), \
98 #define BMO_elem_flag_toggle(bm, ele, oflag) \
99 _bmo_elem_flag_toggle( \
100 bm, (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), oflag)
104 # define _BMO_CAST_V_CONST(e) \
107 (BM_CHECK_TYPE_VERT(_e), \
108 BLI_assert(((const BMHeader *)_e)->htype == BM_VERT), \
109 (const BMVert_OFlag *)_e); \
111 # define _BMO_CAST_E_CONST(e) \
114 (BM_CHECK_TYPE_EDGE(_e), \
115 BLI_assert(((const BMHeader *)_e)->htype == BM_EDGE), \
116 (const BMEdge_OFlag *)_e); \
118 # define _BMO_CAST_F_CONST(e) \
121 (BM_CHECK_TYPE_FACE(_e), \
122 BLI_assert(((const BMHeader *)_e)->htype == BM_FACE), \
123 (const BMFace_OFlag *)_e); \
125 # define _BMO_CAST_V(e) \
128 (BM_CHECK_TYPE_VERT_NONCONST(_e), \
129 BLI_assert(((BMHeader *)_e)->htype == BM_VERT), \
130 (BMVert_OFlag *)_e); \
132 # define _BMO_CAST_E(e) \
135 (BM_CHECK_TYPE_EDGE_NONCONST(_e), \
136 BLI_assert(((BMHeader *)_e)->htype == BM_EDGE), \
137 (BMEdge_OFlag *)_e); \
139 # define _BMO_CAST_F(e) \
142 (BM_CHECK_TYPE_FACE_NONCONST(_e), \
143 BLI_assert(((BMHeader *)_e)->htype == BM_FACE), \
144 (BMFace_OFlag *)_e); \
147 # define _BMO_CAST_V_CONST(e) (BM_CHECK_TYPE_VERT(e), (const BMVert_OFlag *)e)
148 # define _BMO_CAST_E_CONST(e) (BM_CHECK_TYPE_EDGE(e), (const BMEdge_OFlag *)e)
149 # define _BMO_CAST_F_CONST(e) (BM_CHECK_TYPE_FACE(e), (const BMFace_OFlag *)e)
150 # define _BMO_CAST_V(e) (BM_CHECK_TYPE_VERT_NONCONST(e), (BMVert_OFlag *)e)
151 # define _BMO_CAST_E(e) (BM_CHECK_TYPE_EDGE_NONCONST(e), (BMEdge_OFlag *)e)
152 # define _BMO_CAST_F(e) (BM_CHECK_TYPE_FACE_NONCONST(e), (BMFace_OFlag *)e)
155 #define BMO_vert_flag_test(bm, e, oflag) \
156 _bmo_elem_flag_test(bm, _BMO_CAST_V_CONST(e)->oflags, oflag)
157 #define BMO_vert_flag_test_bool(bm, e, oflag) \
158 _bmo_elem_flag_test_bool(bm, _BMO_CAST_V_CONST(e)->oflags, oflag)
159 #define BMO_vert_flag_enable(bm, e, oflag) _bmo_elem_flag_enable(bm, _BMO_CAST_V(e)->oflags, oflag)
160 #define BMO_vert_flag_disable(bm, e, oflag) \
161 _bmo_elem_flag_disable(bm, _BMO_CAST_V(e)->oflags, oflag)
162 #define BMO_vert_flag_set(bm, e, oflag, val) \
163 _bmo_elem_flag_set(bm, _BMO_CAST_V(e)->oflags, oflag, val)
164 #define BMO_vert_flag_toggle(bm, e, oflag) _bmo_elem_flag_toggle(bm, _BMO_CAST_V(e)->oflags, oflag)
166 #define BMO_edge_flag_test(bm, e, oflag) \
167 _bmo_elem_flag_test(bm, _BMO_CAST_E_CONST(e)->oflags, oflag)
168 #define BMO_edge_flag_test_bool(bm, e, oflag) \
169 _bmo_elem_flag_test_bool(bm, _BMO_CAST_E_CONST(e)->oflags, oflag)
170 #define BMO_edge_flag_enable(bm, e, oflag) _bmo_elem_flag_enable(bm, _BMO_CAST_E(e)->oflags, oflag)
171 #define BMO_edge_flag_disable(bm, e, oflag) \
172 _bmo_elem_flag_disable(bm, _BMO_CAST_E(e)->oflags, oflag)
173 #define BMO_edge_flag_set(bm, e, oflag, val) \
174 _bmo_elem_flag_set(bm, _BMO_CAST_E(e)->oflags, oflag, val)
175 #define BMO_edge_flag_toggle(bm, e, oflag) _bmo_elem_flag_toggle(bm, _BMO_CAST_E(e)->oflags, oflag)
177 #define BMO_face_flag_test(bm, e, oflag) \
178 _bmo_elem_flag_test(bm, _BMO_CAST_F_CONST(e)->oflags, oflag)
179 #define BMO_face_flag_test_bool(bm, e, oflag) \
180 _bmo_elem_flag_test_bool(bm, _BMO_CAST_F_CONST(e)->oflags, oflag)
181 #define BMO_face_flag_enable(bm, e, oflag) _bmo_elem_flag_enable(bm, _BMO_CAST_F(e)->oflags, oflag)
182 #define BMO_face_flag_disable(bm, e, oflag) \
183 _bmo_elem_flag_disable(bm, _BMO_CAST_F(e)->oflags, oflag)
184 #define BMO_face_flag_set(bm, e, oflag, val) \
185 _bmo_elem_flag_set(bm, _BMO_CAST_F(e)->oflags, oflag, val)
186 #define BMO_face_flag_toggle(bm, e, oflag) _bmo_elem_flag_toggle(bm, _BMO_CAST_F(e)->oflags, oflag)
216 #define BMO_OP_SLOT_TOTAL_TYPES 11
285 #define BMO_SLOT_AS_BOOL(slot) ((slot)->data.i)
286 #define BMO_SLOT_AS_INT(slot) ((slot)->data.i)
287 #define BMO_SLOT_AS_FLOAT(slot) ((slot)->data.f)
288 #define BMO_SLOT_AS_VECTOR(slot) ((slot)->data.vec)
289 #define BMO_SLOT_AS_MATRIX(slot) ((float(*)[4])((slot)->data.p))
290 #define BMO_SLOT_AS_BUFFER(slot) ((slot)->data.buf)
291 #define BMO_SLOT_AS_GHASH(slot) ((slot)->data.ghash)
293 #define BMO_ASSERT_SLOT_IN_OP(slot, op) \
294 BLI_assert(((slot >= (op)->slots_in) && (slot < &(op)->slots_in[BMO_OP_MAX_SLOTS])) || \
295 ((slot >= (op)->slots_out) && (slot < &(op)->slots_out[BMO_OP_MAX_SLOTS])))
298 #define BMO_OP_MAX_SLOTS 21
325 #define BMO_FLAG_DEFAULTS BMO_FLAG_RESPECT_HIDE
327 #define MAX_SLOTNAME 32
392 #define BMO_slot_copy(op_src, slots_src, slot_name_src, op_dst, slots_dst, slot_name_dst) \
394 (op_src)->slots_src, slot_name_src, (op_dst)->slots_dst, slot_name_dst, (op_dst)->arena)
397 const char *slot_name_src,
399 const char *slot_name_dst,
437 const char *slot_name,
454 const char *slot_name,
464 const char *slot_name,
468 const char *slot_name,
471 const char *slot_name,
480 const bool check_select);
483 #define BMO_slot_buffer_append( \
484 op_src, slots_src, slot_name_src, op_dst, slots_dst, slot_name_dst) \
485 _bmo_slot_buffer_append( \
486 (op_src)->slots_src, slot_name_src, (op_dst)->slots_dst, slot_name_dst, (op_dst)->arena)
488 const char *slot_name_dst,
490 const char *slot_name_src,
498 const char *slot_name,
507 const char *slot_name,
514 const char *slot_name,
520 const char *slot_name,
527 const char *slot_name,
530 const bool do_flush);
534 const char *slot_name,
537 const bool do_flush);
545 const char *slot_name,
555 const char *slot_name,
577 const char *slot_name,
583 const char *slot_name,
589 const char *slot_name,
641 const char *slot_name,
642 const char restrictmask);
652 #define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag) \
653 for (BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_new(iter, slot_args, slot_name, restrict_flag); \
655 BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_step(iter))
657 #define BMO_ITER_INDEX(ele, iter, slot_args, slot_name, restrict_flag, i_) \
658 for (BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_new(iter, slot_args, slot_name, restrict_flag), \
661 BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_step(iter), i_++)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BMO_op_flag_disable(BMesh *bm, BMOperator *op, const int op_flag)
struct BMO_FlagSet BMO_FlagSet
@ BMO_OP_SLOT_SUBTYPE_PTR_BMESH
@ BMO_OP_SLOT_SUBTYPE_PTR_OBJECT
@ BMO_OP_SLOT_SUBTYPE_PTR_SCENE
@ BMO_OP_SLOT_SUBTYPE_PTR_MESH
@ BMO_OP_SLOT_SUBTYPE_PTR_STRUCT
int BMO_mesh_enabled_flag_count(BMesh *bm, const char htype, const short oflag)
void BMO_slot_mat4_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_mat[4][4])
void * BMO_iter_new(BMOIter *iter, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char restrictmask)
New Iterator.
void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag, const bool do_flush)
BMO_FLAG_BUFFER.
@ BMO_SYMMETRIZE_NEGATIVE_X
@ BMO_SYMMETRIZE_NEGATIVE_Y
@ BMO_SYMMETRIZE_POSITIVE_Z
@ BMO_SYMMETRIZE_NEGATIVE_Z
@ BMO_SYMMETRIZE_POSITIVE_Y
@ BMO_SYMMETRIZE_POSITIVE_X
void _bmo_slot_copy(BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS], const char *slot_name_src, BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS], const char *slot_name_dst, struct MemArena *arena_dst)
BMESH OPSTACK COPY SLOT.
void * BMO_slot_buffer_get_first(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_slot_buffer_flag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
BMO_FLAG_BUFFER.
void BMO_slot_vec_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const float vec[3])
void BMO_slot_buffer_from_all(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype)
BMO_ALL_TO_SLOT.
int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag)
void BMO_slot_map_to_flag(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
void BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const bool i)
void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag)
void * BMO_slot_buffer_alloc(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const int len)
BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val)
bool BMO_iter_map_value_bool(BMOIter *iter)
void BMO_mesh_selected_remap(BMesh *bm, BMOpSlot *slot_vert_map, BMOpSlot *slot_edge_map, BMOpSlot *slot_face_map, const bool check_select)
BLI_INLINE bool _bmo_elem_flag_test_bool(BMesh *bm, const BMFlagLayer *oflags, const short oflag)
void BMO_slot_mat_set(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const float *mat, int size)
BLI_INLINE BMFlagLayer * BMO_elem_flag_from_header(BMHeader *ele_head)
@ BMO_OP_SLOT_SUBTYPE_ELEM_EDGE
@ BMO_OP_SLOT_SUBTYPE_ELEM_FACE
@ BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE
@ BMO_OP_SLOT_SUBTYPE_ELEM_VERT
BLI_INLINE short _bmo_elem_flag_test(BMesh *bm, const BMFlagLayer *oflags, const short oflag)
@ BMO_OP_SLOT_ELEMENT_BUF
void BMO_slot_buffer_from_disabled_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag)
void BMO_slot_vec_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_vec[3])
void * BMO_iter_step(BMOIter *iter)
float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void * BMO_slot_buffer_get_single(BMOpSlot *slot)
void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
void BMO_slot_buffer_from_single(BMOperator *op, BMOpSlot *slot, BMHeader *ele)
void _bmo_slot_buffer_append(BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS], const char *slot_name_dst, BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS], const char *slot_name_src, struct MemArena *arena_dst)
struct BMOperator BMOperator
int BMO_iter_map_value_int(BMOIter *iter)
void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag, const bool do_flush)
BMO_FLAG_BUFFER.
void BMO_op_exec(BMesh *bm, BMOperator *op)
BMESH OPSTACK EXEC OP.
void BMO_pop(BMesh *bm)
BMESH OPSTACK POP.
bool BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt,...)
@ BMO_OP_SLOT_SUBTYPE_MAP_ELEM
@ BMO_OP_SLOT_SUBTYPE_MAP_BOOL
@ BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL
@ BMO_OP_SLOT_SUBTYPE_MAP_INT
@ BMO_OP_SLOT_SUBTYPE_MAP_EMPTY
@ BMO_OP_SLOT_SUBTYPE_MAP_FLT
void * BMO_slot_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int *len)
void BMO_push(BMesh *bm, BMOperator *op)
int BMO_opcode_from_opname(const char *opname)
struct BMOpDefine BMOpDefine
void ** BMO_iter_map_value_p(BMOIter *iter)
@ BMO_OP_SLOT_SUBTYPE_INT_FLAG
@ BMO_OP_SLOT_SUBTYPE_INT_ENUM
const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES]
void BMO_op_flag_enable(BMesh *bm, BMOperator *op, const int op_flag)
float BMO_iter_map_value_float(BMOIter *iter)
BLI_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
int BMO_slot_map_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_slot_mat3_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_mat[3][3])
int BMO_slot_buffer_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_slot_buffer_from_array(BMOperator *op, BMOpSlot *slot, BMHeader **ele_buffer, int ele_buffer_len)
int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_slot_float_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const float f)
void BMO_op_finish(BMesh *bm, BMOperator *op)
BMESH OPSTACK FINISH OP.
struct BMOSlotType BMOSlotType
void BMO_slot_map_insert(BMOperator *op, BMOpSlot *slot, const void *element, const void *data)
void * BMO_iter_map_value_ptr(BMOIter *iter)
#define BMO_OP_SLOT_TOTAL_TYPES
void BMO_slot_ptr_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *p)
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
@ DEL_FACES_KEEP_BOUNDARY
void * BMO_slot_ptr_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
BLI_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag)
void BMO_slot_int_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const int i)
void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, const char htype, const short oflag)
union eBMOpSlotSubType_Union eBMOpSlotSubType_Union
@ BMO_OPTYPE_FLAG_INVALIDATE_CLNOR_ALL
@ BMO_OPTYPE_FLAG_SELECT_VALIDATE
@ BMO_OPTYPE_FLAG_UNTAN_MULTIRES
@ BMO_OPTYPE_FLAG_NORMALS_CALC
@ BMO_OPTYPE_FLAG_SELECT_FLUSH
BLI_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
void BMO_slot_buffer_flag_disable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
BMO_FLAG_BUFFER.
bool BMO_slot_exists(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK HAS SLOT.
bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, va_list vlist)
Format Strings for BMOperator Initialization.
void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname)
BMESH OPSTACK INIT OP.
bool BMO_op_callf(BMesh *bm, const int flag, const char *fmt,...)
ATTR_WARN_UNUSED_RESULT const void * element
ATTR_WARN_UNUSED_RESULT const BMFlagLayer const short oflag
ATTR_WARN_UNUSED_RESULT const BMFlagLayer * oflags
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
eBMOpSlotSubType_Union subtype
BMOSlotType slot_types_in[BMO_OP_MAX_SLOTS]
BMOSlotType slot_types_out[BMO_OP_MAX_SLOTS]
void(* exec)(BMesh *bm, BMOperator *op)
eBMOpSlotSubType_Union slot_subtype
union BMOpSlot::@139 data
struct BMOpSlot::@139::@140 enum_data
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
void(* exec)(BMesh *bm, struct BMOperator *op)
eBMOpSlotSubType_Int intg
eBMOpSlotSubType_Elem elem