Blender  V3.3
bmesh_operator_api.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
9 #include "BLI_ghash.h"
10 
11 #include <stdarg.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
55 struct GHashIterator;
56 
58 {
59  switch (ele_head->htype) {
60  case BM_VERT:
61  return ((BMVert_OFlag *)ele_head)->oflags;
62  case BM_EDGE:
63  return ((BMEdge_OFlag *)ele_head)->oflags;
64  default:
65  return ((BMFace_OFlag *)ele_head)->oflags;
66  }
67 }
68 
69 #define BMO_elem_flag_test(bm, ele, oflag) \
70  _bmo_elem_flag_test(bm, BMO_elem_flag_from_header(&(ele)->head), oflag)
71 #define BMO_elem_flag_test_bool(bm, ele, oflag) \
72  _bmo_elem_flag_test_bool(bm, BMO_elem_flag_from_header(&(ele)->head), oflag)
73 #define BMO_elem_flag_enable(bm, ele, oflag) \
74  _bmo_elem_flag_enable( \
75  bm, (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), oflag)
76 #define BMO_elem_flag_disable(bm, ele, oflag) \
77  _bmo_elem_flag_disable( \
78  bm, (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), oflag)
79 #define BMO_elem_flag_set(bm, ele, oflag, val) \
80  _bmo_elem_flag_set(bm, \
81  (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), \
82  oflag, \
83  val)
84 #define BMO_elem_flag_toggle(bm, ele, oflag) \
85  _bmo_elem_flag_toggle( \
86  bm, (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), oflag)
87 
88 /* take care not to instantiate args multiple times */
89 #ifdef __GNUC___
90 # define _BMO_CAST_V_CONST(e) \
91  ({ \
92  typeof(e) _e = e; \
93  (BM_CHECK_TYPE_VERT(_e), \
94  BLI_assert(((const BMHeader *)_e)->htype == BM_VERT), \
95  (const BMVert_OFlag *)_e); \
96  })
97 # define _BMO_CAST_E_CONST(e) \
98  ({ \
99  typeof(e) _e = e; \
100  (BM_CHECK_TYPE_EDGE(_e), \
101  BLI_assert(((const BMHeader *)_e)->htype == BM_EDGE), \
102  (const BMEdge_OFlag *)_e); \
103  })
104 # define _BMO_CAST_F_CONST(e) \
105  ({ \
106  typeof(e) _e = e; \
107  (BM_CHECK_TYPE_FACE(_e), \
108  BLI_assert(((const BMHeader *)_e)->htype == BM_FACE), \
109  (const BMFace_OFlag *)_e); \
110  })
111 # define _BMO_CAST_V(e) \
112  ({ \
113  typeof(e) _e = e; \
114  (BM_CHECK_TYPE_VERT_NONCONST(_e), \
115  BLI_assert(((BMHeader *)_e)->htype == BM_VERT), \
116  (BMVert_OFlag *)_e); \
117  })
118 # define _BMO_CAST_E(e) \
119  ({ \
120  typeof(e) _e = e; \
121  (BM_CHECK_TYPE_EDGE_NONCONST(_e), \
122  BLI_assert(((BMHeader *)_e)->htype == BM_EDGE), \
123  (BMEdge_OFlag *)_e); \
124  })
125 # define _BMO_CAST_F(e) \
126  ({ \
127  typeof(e) _e = e; \
128  (BM_CHECK_TYPE_FACE_NONCONST(_e), \
129  BLI_assert(((BMHeader *)_e)->htype == BM_FACE), \
130  (BMFace_OFlag *)_e); \
131  })
132 #else
133 # define _BMO_CAST_V_CONST(e) (BM_CHECK_TYPE_VERT(e), (const BMVert_OFlag *)e)
134 # define _BMO_CAST_E_CONST(e) (BM_CHECK_TYPE_EDGE(e), (const BMEdge_OFlag *)e)
135 # define _BMO_CAST_F_CONST(e) (BM_CHECK_TYPE_FACE(e), (const BMFace_OFlag *)e)
136 # define _BMO_CAST_V(e) (BM_CHECK_TYPE_VERT_NONCONST(e), (BMVert_OFlag *)e)
137 # define _BMO_CAST_E(e) (BM_CHECK_TYPE_EDGE_NONCONST(e), (BMEdge_OFlag *)e)
138 # define _BMO_CAST_F(e) (BM_CHECK_TYPE_FACE_NONCONST(e), (BMFace_OFlag *)e)
139 #endif
140 
141 #define BMO_vert_flag_test(bm, e, oflag) \
142  _bmo_elem_flag_test(bm, _BMO_CAST_V_CONST(e)->oflags, oflag)
143 #define BMO_vert_flag_test_bool(bm, e, oflag) \
144  _bmo_elem_flag_test_bool(bm, _BMO_CAST_V_CONST(e)->oflags, oflag)
145 #define BMO_vert_flag_enable(bm, e, oflag) _bmo_elem_flag_enable(bm, _BMO_CAST_V(e)->oflags, oflag)
146 #define BMO_vert_flag_disable(bm, e, oflag) \
147  _bmo_elem_flag_disable(bm, _BMO_CAST_V(e)->oflags, oflag)
148 #define BMO_vert_flag_set(bm, e, oflag, val) \
149  _bmo_elem_flag_set(bm, _BMO_CAST_V(e)->oflags, oflag, val)
150 #define BMO_vert_flag_toggle(bm, e, oflag) _bmo_elem_flag_toggle(bm, _BMO_CAST_V(e)->oflags, oflag)
151 
152 #define BMO_edge_flag_test(bm, e, oflag) \
153  _bmo_elem_flag_test(bm, _BMO_CAST_E_CONST(e)->oflags, oflag)
154 #define BMO_edge_flag_test_bool(bm, e, oflag) \
155  _bmo_elem_flag_test_bool(bm, _BMO_CAST_E_CONST(e)->oflags, oflag)
156 #define BMO_edge_flag_enable(bm, e, oflag) _bmo_elem_flag_enable(bm, _BMO_CAST_E(e)->oflags, oflag)
157 #define BMO_edge_flag_disable(bm, e, oflag) \
158  _bmo_elem_flag_disable(bm, _BMO_CAST_E(e)->oflags, oflag)
159 #define BMO_edge_flag_set(bm, e, oflag, val) \
160  _bmo_elem_flag_set(bm, _BMO_CAST_E(e)->oflags, oflag, val)
161 #define BMO_edge_flag_toggle(bm, e, oflag) _bmo_elem_flag_toggle(bm, _BMO_CAST_E(e)->oflags, oflag)
162 
163 #define BMO_face_flag_test(bm, e, oflag) \
164  _bmo_elem_flag_test(bm, _BMO_CAST_F_CONST(e)->oflags, oflag)
165 #define BMO_face_flag_test_bool(bm, e, oflag) \
166  _bmo_elem_flag_test_bool(bm, _BMO_CAST_F_CONST(e)->oflags, oflag)
167 #define BMO_face_flag_enable(bm, e, oflag) _bmo_elem_flag_enable(bm, _BMO_CAST_F(e)->oflags, oflag)
168 #define BMO_face_flag_disable(bm, e, oflag) \
169  _bmo_elem_flag_disable(bm, _BMO_CAST_F(e)->oflags, oflag)
170 #define BMO_face_flag_set(bm, e, oflag, val) \
171  _bmo_elem_flag_set(bm, _BMO_CAST_F(e)->oflags, oflag, val)
172 #define BMO_face_flag_toggle(bm, e, oflag) _bmo_elem_flag_toggle(bm, _BMO_CAST_F(e)->oflags, oflag)
173 
178 BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, short oflag, int val);
180 
181 /* slot type arrays are terminated by the last member
182  * having a slot type of 0 */
183 typedef enum eBMOpSlotType {
184  /* BMO_OP_SLOT_SENTINEL = 0, */
188 
189  /* normally store pointers to object, scene,
190  * _never_ store arrays corresponding to mesh elements with this */
191  BMO_OP_SLOT_PTR = 4, /* requires subtype BMO_OP_SLOT_SUBTYPE_PTR_xxx */
194 
195  /* after BMO_OP_SLOT_VEC, everything is dynamically allocated arrays.
196  * We leave a space in the identifiers for future growth.
197  *
198  * it's very important this remain a power of two */
199  BMO_OP_SLOT_ELEMENT_BUF = 9, /* list of verts/edges/faces */
200  BMO_OP_SLOT_MAPPING = 10 /* simple hash map, requires subtype BMO_OP_SLOT_SUBTYPE_MAP_xxx */
202 #define BMO_OP_SLOT_TOTAL_TYPES 11
203 
204 /* don't overlap values to avoid confusion */
205 typedef enum eBMOpSlotSubType_Elem {
206  /* use as flags */
212 typedef enum eBMOpSlotSubType_Map {
213  BMO_OP_SLOT_SUBTYPE_MAP_EMPTY = 64, /* use as a set(), unused value */
218  BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL = 69, /* python can't convert these */
220 typedef enum eBMOpSlotSubType_Ptr {
227 typedef enum eBMOpSlotSubType_Int {
231 
232 typedef union eBMOpSlotSubType_Union {
238 
239 typedef struct BMO_FlagSet {
240  int value;
241  const char *identifier;
243 
244 /* please ignore all these structures, don't touch them in tool code, except
245  * for when your defining an operator with BMOpDefine. */
246 
247 typedef struct BMOpSlot {
248  const char *slot_name; /* pointer to BMOpDefine.slot_args */
251 
252  int len;
253  // int flag; /* UNUSED */
254  // int index; /* index within slot array */ /* UNUSED */
255  union {
256  int i;
257  float f;
258  void *p;
259  float vec[3];
260  void **buf;
262  struct {
264  int _i;
267  } data;
269 
270 /* mainly for use outside bmesh internal code */
271 #define BMO_SLOT_AS_BOOL(slot) ((slot)->data.i)
272 #define BMO_SLOT_AS_INT(slot) ((slot)->data.i)
273 #define BMO_SLOT_AS_FLOAT(slot) ((slot)->data.f)
274 #define BMO_SLOT_AS_VECTOR(slot) ((slot)->data.vec)
275 #define BMO_SLOT_AS_MATRIX(slot) ((float(*)[4])((slot)->data.p))
276 #define BMO_SLOT_AS_BUFFER(slot) ((slot)->data.buf)
277 #define BMO_SLOT_AS_GHASH(slot) ((slot)->data.ghash)
278 
279 #define BMO_ASSERT_SLOT_IN_OP(slot, op) \
280  BLI_assert(((slot >= (op)->slots_in) && (slot < &(op)->slots_in[BMO_OP_MAX_SLOTS])) || \
281  ((slot >= (op)->slots_out) && (slot < &(op)->slots_out[BMO_OP_MAX_SLOTS])))
282 
283 /* Limit hit, so expanded for bevel operator. Compiler complains if limit is hit. */
284 #define BMO_OP_MAX_SLOTS 21
285 
286 /* BMOpDefine->type_flag */
287 typedef enum {
295 } BMOpTypeFlag;
296 
297 typedef struct BMOperator {
300  void (*exec)(BMesh *bm, struct BMOperator *op);
301  struct MemArena *arena;
302  int type;
304  int flag; /* runtime options */
306 
307 enum {
309 };
310 
311 #define BMO_FLAG_DEFAULTS BMO_FLAG_RESPECT_HIDE
312 
313 #define MAX_SLOTNAME 32
314 
315 typedef struct BMOSlotType {
321 
322 typedef struct BMOpDefine {
323  const char *opname;
329 
330 /* -------------------------------------------------------------------- */
342 void BMO_op_init(BMesh *bm, BMOperator *op, int flag, const char *opname);
343 
353 void BMO_op_exec(BMesh *bm, BMOperator *op);
354 
362 void BMO_op_finish(BMesh *bm, BMOperator *op);
363 
368 int BMO_mesh_enabled_flag_count(BMesh *bm, char htype, short oflag);
369 
374 int BMO_mesh_disabled_flag_count(BMesh *bm, char htype, short oflag);
375 
389 void BMO_pop(BMesh *bm);
390 
393 /* -------------------------------------------------------------------- */
451 bool BMO_op_callf(BMesh *bm, int flag, const char *fmt, ...);
452 
458 bool BMO_op_initf(BMesh *bm, BMOperator *op, int flag, const char *fmt, ...);
459 
464 bool BMO_op_vinitf(BMesh *bm, BMOperator *op, int flag, const char *fmt, va_list vlist);
465 
468 /* -------------------------------------------------------------------- */
477 bool BMO_slot_exists(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
478 
479 /* get a pointer to a slot. this may be removed layer on from the public API. */
485 BMOpSlot *BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
486 
487 /* copies the data of a slot from one operator to another. src and dst are the
488  * source/destination slot codes, respectively. */
489 #define BMO_slot_copy(op_src, slots_src, slot_name_src, op_dst, slots_dst, slot_name_dst) \
490  _bmo_slot_copy( \
491  (op_src)->slots_src, slot_name_src, (op_dst)->slots_dst, slot_name_dst, (op_dst)->arena)
492 
499 void _bmo_slot_copy(BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS],
500  const char *slot_name_src,
501  BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS],
502  const char *slot_name_dst,
503  struct MemArena *arena_dst);
504 
507 /* del "context" slot values, used for operator too */
508 enum {
514  /* A version of 'DEL_FACES' that keeps edges on face boundaries,
515  * allowing the surrounding edge-loop to be kept from removed face regions. */
518 };
519 
520 typedef enum {
524 
529 
530 typedef enum {
533  BMO_DELIM_SEAM = 1 << 2,
534  BMO_DELIM_SHARP = 1 << 3,
535  BMO_DELIM_UV = 1 << 4,
536 } BMO_Delimit;
537 
538 void BMO_op_flag_enable(BMesh *bm, BMOperator *op, int op_flag);
539 void BMO_op_flag_disable(BMesh *bm, BMOperator *op, int op_flag);
540 
541 /* -------------------------------------------------------------------- */
545 void BMO_slot_float_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float f);
546 float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
547 void BMO_slot_int_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int i);
548 int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
549 void BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, bool i);
550 bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
554 void *BMO_slot_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int *len);
555 
562 void BMO_slot_ptr_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *p);
563 void *BMO_slot_ptr_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
565  const char *slot_name,
566  const float vec[3]);
567 void BMO_slot_vec_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_vec[3]);
568 
576  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
577  const char *slot_name,
578  const float *mat,
579  int size);
581  const char *slot_name,
582  float r_mat[4][4]);
584  const char *slot_name,
585  float r_mat[3][3]);
586 
589 void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, char htype, short oflag);
590 
592  BMOpSlot *slot_vert_map,
593  BMOpSlot *slot_edge_map,
594  BMOpSlot *slot_face_map,
595  bool check_select);
596 
600 #define BMO_slot_buffer_append( \
601  op_src, slots_src, slot_name_src, op_dst, slots_dst, slot_name_dst) \
602  _bmo_slot_buffer_append( \
603  (op_src)->slots_src, slot_name_src, (op_dst)->slots_dst, slot_name_dst, (op_dst)->arena)
608  const char *slot_name_dst,
609  BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS],
610  const char *slot_name_src,
611  struct MemArena *arena_dst);
612 
617  BMOperator *op,
618  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
619  const char *slot_name,
620  char htype,
621  short oflag);
622 
627  BMOperator *op,
628  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
629  const char *slot_name,
630  char htype,
631  short oflag);
632 
639  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
640  const char *slot_name,
641  char htype,
642  short oflag);
649  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
650  const char *slot_name,
651  char htype,
652  short oflag);
653 
661  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
662  const char *slot_name,
663  char htype,
664  char hflag,
665  bool do_flush);
673  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
674  const char *slot_name,
675  char htype,
676  char hflag,
677  bool do_flush);
678 
684  BMOperator *op,
685  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
686  const char *slot_name,
687  char htype,
688  char hflag);
694  BMOperator *op,
695  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
696  const char *slot_name,
697  char htype,
698  char hflag);
699 
701  BMOpSlot *slot,
702  BMHeader **ele_buffer,
703  int ele_buffer_len);
704 
707 
709 int BMO_slot_buffer_len(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
711 int BMO_slot_map_len(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
712 
717 void BMO_slot_map_insert(BMOperator *op, BMOpSlot *slot, const void *element, const void *data);
718 
724  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
725  const char *slot_name,
726  char htype,
727  short oflag);
728 
730  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
731  const char *slot_name,
732  int len);
733 
740  BMOperator *op,
741  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
742  const char *slot_name,
743  char htype);
744 
780 /* contents of this structure are private,
781  * don't directly access. */
782 typedef struct BMOIter {
784  int cur; // for arrays
786  void **val;
790 
791 void *BMO_slot_buffer_get_first(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
792 
799 void *BMO_iter_new(BMOIter *iter,
800  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
801  const char *slot_name,
802  char restrictmask);
803 void *BMO_iter_step(BMOIter *iter);
804 
809 void **BMO_iter_map_value_p(BMOIter *iter);
810 void *BMO_iter_map_value_ptr(BMOIter *iter);
811 
812 float BMO_iter_map_value_float(BMOIter *iter);
814 bool BMO_iter_map_value_bool(BMOIter *iter);
815 
816 #define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag) \
817  for (BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_new(iter, slot_args, slot_name, restrict_flag); \
818  ele; \
819  BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_step(iter))
820 
821 #define BMO_ITER_INDEX(ele, iter, slot_args, slot_name, restrict_flag, i_) \
822  for (BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_new(iter, slot_args, slot_name, restrict_flag), \
823  i_ = 0; \
824  ele; \
825  BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_step(iter), i_++)
826 
827 /* operator slot type information - size of one element of the type given. */
829 
830 int BMO_opcode_from_opname(const char *opname);
831 
832 #ifdef __cplusplus
833 }
834 #endif
#define BLI_INLINE
@ BM_FACE
Definition: bmesh_class.h:386
@ BM_VERT
Definition: bmesh_class.h:383
@ BM_EDGE
Definition: bmesh_class.h:384
ATTR_WARN_UNUSED_RESULT BMesh * bm
struct BMO_FlagSet BMO_FlagSet
eBMOpSlotSubType_Ptr
@ 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
void BMO_op_flag_disable(BMesh *bm, BMOperator *op, int op_flag)
BLI_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, short oflag)
void BMO_slot_mat4_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_mat[4][4])
BMO_SymmDirection
@ 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_buffer_alloc(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int len)
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_from_disabled_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag)
void BMO_slot_vec_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const float vec[3])
void BMO_slot_buffer_flag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
BMO_FLAG_BUFFER.
bool BMO_op_vinitf(BMesh *bm, BMOperator *op, int flag, const char *fmt, va_list vlist)
void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag, bool do_flush)
BMO_FLAG_BUFFER.
bool BMO_iter_map_value_bool(BMOIter *iter)
void BMO_slot_map_to_flag(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, char htype, 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)
eBMOpSlotSubType_Elem
@ 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
eBMOpSlotType
@ BMO_OP_SLOT_ELEMENT_BUF
@ BMO_OP_SLOT_PTR
@ BMO_OP_SLOT_BOOL
@ BMO_OP_SLOT_FLT
@ BMO_OP_SLOT_INT
@ BMO_OP_SLOT_VEC
@ BMO_OP_SLOT_MAPPING
@ BMO_OP_SLOT_MAT
void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
int BMO_mesh_disabled_flag_count(BMesh *bm, char htype, short oflag)
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)
void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag, bool do_flush)
BMO_FLAG_BUFFER.
@ DEL_ONLYTAGGED
@ DEL_FACES_KEEP_BOUNDARY
@ DEL_EDGESFACES
@ DEL_EDGES
@ DEL_FACES
@ DEL_ONLYFACES
@ DEL_VERTS
int BMO_slot_map_len(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
BLI_INLINE bool _bmo_elem_flag_test_bool(BMesh *bm, const BMFlagLayer *oflags, short oflag)
void BMO_mesh_selected_remap(BMesh *bm, BMOpSlot *slot_vert_map, BMOpSlot *slot_edge_map, BMOpSlot *slot_face_map, bool check_select)
float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void * BMO_slot_buffer_get_single(BMOpSlot *slot)
struct BMOpSlot BMOpSlot
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)
void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag)
struct BMOperator BMOperator
int BMO_iter_map_value_int(BMOIter *iter)
void BMO_slot_float_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float f)
void * BMO_iter_new(BMOIter *iter, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char restrictmask)
New Iterator.
#define MAX_SLOTNAME
struct BMOIter BMOIter
BLI_INLINE short _bmo_elem_flag_test(BMesh *bm, const BMFlagLayer *oflags, short oflag)
void BMO_op_exec(BMesh *bm, BMOperator *op)
BMESH OPSTACK EXEC OP.
void BMO_pop(BMesh *bm)
BMESH OPSTACK POP.
eBMOpSlotSubType_Map
@ 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_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
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)
BMESH OPSTACK PUSH.
@ BMO_FLAG_RESPECT_HIDE
int BMO_opcode_from_opname(const char *opname)
struct BMOpDefine BMOpDefine
void ** BMO_iter_map_value_p(BMOIter *iter)
BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, short oflag, int val)
void BMO_op_flag_enable(BMesh *bm, BMOperator *op, int op_flag)
eBMOpSlotSubType_Int
@ BMO_OP_SLOT_SUBTYPE_INT_FLAG
@ BMO_OP_SLOT_SUBTYPE_INT_ENUM
const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES]
void BMO_slot_int_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int i)
void BMO_op_init(BMesh *bm, BMOperator *op, int flag, const char *opname)
BMESH OPSTACK INIT OP.
float BMO_iter_map_value_float(BMOIter *iter)
#define BMO_OP_MAX_SLOTS
void BMO_slot_mat3_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_mat[3][3])
void BMO_slot_buffer_from_array(BMOperator *op, BMOpSlot *slot, BMHeader **ele_buffer, int ele_buffer_len)
bool BMO_op_initf(BMesh *bm, BMOperator *op, int flag, const char *fmt,...)
int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
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)
int BMO_slot_buffer_len(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
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)
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
void BMO_slot_buffer_from_all(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype)
BMO_ALL_TO_SLOT.
void BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, bool i)
void * BMO_slot_ptr_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_slot_buffer_flag_disable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
BMO_FLAG_BUFFER.
BLI_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, short oflag)
int BMO_mesh_enabled_flag_count(BMesh *bm, char htype, short oflag)
union eBMOpSlotSubType_Union eBMOpSlotSubType_Union
BMOpTypeFlag
@ BMO_OPTYPE_FLAG_NOP
@ 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_toggle(BMesh *bm, BMFlagLayer *oflags, short oflag)
bool BMO_slot_exists(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK HAS SLOT.
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
@ BMO_DELIM_NORMAL
@ BMO_DELIM_MATERIAL
@ BMO_DELIM_SEAM
@ BMO_DELIM_SHARP
@ BMO_DELIM_UV
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)
Definition: btDbvt.cpp:52
SyclQueue void void size_t num_bytes void
int len
Definition: draw_manager.c:108
char htype
Definition: bmesh_class.h:64
BMOpSlot * slot
GHashIterator giter
BMO_FlagSet * enum_flags
eBMOpSlotSubType_Union subtype
eBMOpSlotType type
char name[MAX_SLOTNAME]
const char * identifier
BMOpTypeFlag type_flag
const char * opname
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
eBMOpSlotType slot_type
struct BMOpSlot::@145::@146 enum_data
BMO_FlagSet * flags
union BMOpSlot::@145 data
const char * slot_name
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct MemArena * arena
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
void(* exec)(BMesh *bm, struct BMOperator *op)
BMOpTypeFlag type_flag
eBMOpSlotSubType_Ptr ptr
eBMOpSlotSubType_Int intg
eBMOpSlotSubType_Elem elem
eBMOpSlotSubType_Map map