Blender  V2.93
bmesh_operator_api.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
23 #include "BLI_ghash.h"
24 
25 #include <stdarg.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
69 struct GHashIterator;
70 
72 {
73  switch (ele_head->htype) {
74  case BM_VERT:
75  return ((BMVert_OFlag *)ele_head)->oflags;
76  case BM_EDGE:
77  return ((BMEdge_OFlag *)ele_head)->oflags;
78  default:
79  return ((BMFace_OFlag *)ele_head)->oflags;
80  }
81 }
82 
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)), \
96  oflag, \
97  val)
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)
101 
102 /* take care not to instantiate args multiple times */
103 #ifdef __GNUC___
104 # define _BMO_CAST_V_CONST(e) \
105  ({ \
106  typeof(e) _e = e; \
107  (BM_CHECK_TYPE_VERT(_e), \
108  BLI_assert(((const BMHeader *)_e)->htype == BM_VERT), \
109  (const BMVert_OFlag *)_e); \
110  })
111 # define _BMO_CAST_E_CONST(e) \
112  ({ \
113  typeof(e) _e = e; \
114  (BM_CHECK_TYPE_EDGE(_e), \
115  BLI_assert(((const BMHeader *)_e)->htype == BM_EDGE), \
116  (const BMEdge_OFlag *)_e); \
117  })
118 # define _BMO_CAST_F_CONST(e) \
119  ({ \
120  typeof(e) _e = e; \
121  (BM_CHECK_TYPE_FACE(_e), \
122  BLI_assert(((const BMHeader *)_e)->htype == BM_FACE), \
123  (const BMFace_OFlag *)_e); \
124  })
125 # define _BMO_CAST_V(e) \
126  ({ \
127  typeof(e) _e = e; \
128  (BM_CHECK_TYPE_VERT_NONCONST(_e), \
129  BLI_assert(((BMHeader *)_e)->htype == BM_VERT), \
130  (BMVert_OFlag *)_e); \
131  })
132 # define _BMO_CAST_E(e) \
133  ({ \
134  typeof(e) _e = e; \
135  (BM_CHECK_TYPE_EDGE_NONCONST(_e), \
136  BLI_assert(((BMHeader *)_e)->htype == BM_EDGE), \
137  (BMEdge_OFlag *)_e); \
138  })
139 # define _BMO_CAST_F(e) \
140  ({ \
141  typeof(e) _e = e; \
142  (BM_CHECK_TYPE_FACE_NONCONST(_e), \
143  BLI_assert(((BMHeader *)_e)->htype == BM_FACE), \
144  (BMFace_OFlag *)_e); \
145  })
146 #else
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)
153 #endif
154 
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)
165 
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)
176 
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)
187 
192 BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val);
194 
195 /* slot type arrays are terminated by the last member
196  * having a slot type of 0 */
197 typedef enum eBMOpSlotType {
198  /* BMO_OP_SLOT_SENTINEL = 0, */
202 
203  /* normally store pointers to object, scene,
204  * _never_ store arrays corresponding to mesh elements with this */
205  BMO_OP_SLOT_PTR = 4, /* requires subtype BMO_OP_SLOT_SUBTYPE_PTR_xxx */
208 
209  /* after BMO_OP_SLOT_VEC, everything is dynamically allocated arrays.
210  * We leave a space in the identifiers for future growth.
211  *
212  * it's very important this remain a power of two */
213  BMO_OP_SLOT_ELEMENT_BUF = 9, /* list of verts/edges/faces */
214  BMO_OP_SLOT_MAPPING = 10 /* simple hash map, requires subtype BMO_OP_SLOT_SUBTYPE_MAP_xxx */
216 #define BMO_OP_SLOT_TOTAL_TYPES 11
217 
218 /* don't overlap values to avoid confusion */
219 typedef enum eBMOpSlotSubType_Elem {
220  /* use as flags */
226 typedef enum eBMOpSlotSubType_Map {
227  BMO_OP_SLOT_SUBTYPE_MAP_EMPTY = 64, /* use as a set(), unused value */
232  BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL = 69, /* python can't convert these */
234 typedef enum eBMOpSlotSubType_Ptr {
241 typedef enum eBMOpSlotSubType_Int {
245 
246 typedef union eBMOpSlotSubType_Union {
252 
253 typedef struct BMO_FlagSet {
254  int value;
255  const char *identifier;
257 
258 /* please ignore all these structures, don't touch them in tool code, except
259  * for when your defining an operator with BMOpDefine.*/
260 
261 typedef struct BMOpSlot {
262  const char *slot_name; /* pointer to BMOpDefine.slot_args */
265 
266  int len;
267  // int flag; /* UNUSED */
268  // int index; /* index within slot array */ /* UNUSED */
269  union {
270  int i;
271  float f;
272  void *p;
273  float vec[3];
274  void **buf;
276  struct {
278  int _i;
281  } data;
283 
284 /* mainly for use outside bmesh internal code */
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)
292 
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])))
296 
297 /* Limit hit, so expanded for bevel operator. Compiler complains if limit is hit. */
298 #define BMO_OP_MAX_SLOTS 21
299 
300 /* BMOpDefine->type_flag */
301 typedef enum {
309 } BMOpTypeFlag;
310 
311 typedef struct BMOperator {
314  void (*exec)(BMesh *bm, struct BMOperator *op);
315  struct MemArena *arena;
316  int type;
318  int flag; /* runtime options */
320 
321 enum {
323 };
324 
325 #define BMO_FLAG_DEFAULTS BMO_FLAG_RESPECT_HIDE
326 
327 #define MAX_SLOTNAME 32
328 
329 typedef struct BMOSlotType {
335 
336 typedef struct BMOpDefine {
337  const char *opname;
340  void (*exec)(BMesh *bm, BMOperator *op);
343 
344 /*------------- Operator API --------------*/
345 
346 /* data types that use pointers (arrays, etc) should never
347  * have it set directly. and never use BMO_slot_ptr_set to
348  * pass in a list of edges or any arrays, really.*/
349 
350 void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname);
351 
352 /* executes an operator, pushing and popping a new tool flag
353  * layer as appropriate.*/
354 void BMO_op_exec(BMesh *bm, BMOperator *op);
355 
356 /* finishes an operator (though note the operator's tool flag is removed
357  * after it finishes executing in BMO_op_exec).*/
358 void BMO_op_finish(BMesh *bm, BMOperator *op);
359 
360 /* count the number of elements with the specified flag enabled.
361  * type can be a bitmask of BM_FACE, BM_EDGE, or BM_FACE. */
362 int BMO_mesh_enabled_flag_count(BMesh *bm, const char htype, const short oflag);
363 
364 /* count the number of elements with the specified flag disabled.
365  * type can be a bitmask of BM_FACE, BM_EDGE, or BM_FACE. */
366 int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag);
367 
368 /*---------formatted operator initialization/execution-----------*/
370 void BMO_pop(BMesh *bm);
371 
372 /*executes an operator*/
373 bool BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...);
374 
375 /* initializes, but doesn't execute an operator. this is so you can
376  * gain access to the outputs of the operator. note that you have
377  * to execute/finish (BMO_op_exec and BMO_op_finish) yourself. */
378 bool BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, ...);
379 
380 /* va_list version, used to implement the above two functions,
381  * plus EDBM_op_callf in editmesh_utils.c. */
382 bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, va_list vlist);
383 
384 /* test whether a named slot exists */
385 bool BMO_slot_exists(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
386 
387 /* get a pointer to a slot. this may be removed layer on from the public API. */
388 BMOpSlot *BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
389 
390 /* copies the data of a slot from one operator to another. src and dst are the
391  * source/destination slot codes, respectively. */
392 #define BMO_slot_copy(op_src, slots_src, slot_name_src, op_dst, slots_dst, slot_name_dst) \
393  _bmo_slot_copy( \
394  (op_src)->slots_src, slot_name_src, (op_dst)->slots_dst, slot_name_dst, (op_dst)->arena)
395 
396 void _bmo_slot_copy(BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS],
397  const char *slot_name_src,
398  BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS],
399  const char *slot_name_dst,
400  struct MemArena *arena_dst);
401 
402 /* del "context" slot values, used for operator too */
403 enum {
409  /* A version of 'DEL_FACES' that keeps edges on face boundaries,
410  * allowing the surrounding edge-loop to be kept from removed face regions. */
413 };
414 
415 typedef enum {
419 
424 
425 typedef enum {
428  BMO_DELIM_SEAM = 1 << 2,
429  BMO_DELIM_SHARP = 1 << 3,
430  BMO_DELIM_UV = 1 << 4,
431 } BMO_Delimit;
432 
433 void BMO_op_flag_enable(BMesh *bm, BMOperator *op, const int op_flag);
434 void BMO_op_flag_disable(BMesh *bm, BMOperator *op, const int op_flag);
435 
437  const char *slot_name,
438  const float f);
439 float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
440 void BMO_slot_int_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const int i);
441 int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
442 void BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const bool i);
443 bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
444 void *BMO_slot_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int *len);
445 
446 /* don't pass in arrays that are supposed to map to elements this way.
447  *
448  * so, e.g. passing in list of floats per element in another slot is bad.
449  * passing in, e.g. pointer to an editmesh for the conversion operator is fine
450  * though. */
451 void BMO_slot_ptr_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *p);
452 void *BMO_slot_ptr_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
454  const char *slot_name,
455  const float vec[3]);
456 void BMO_slot_vec_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_vec[3]);
457 
458 /* only supports square mats */
459 /* size must be 3 or 4; this api is meant only for transformation matrices.
460  * note that internally the matrix is stored in 4x4 form, and it's safe to
461  * call whichever BMO_Get_MatXXX function you want. */
463  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
464  const char *slot_name,
465  const float *mat,
466  int size);
468  const char *slot_name,
469  float r_mat[4][4]);
471  const char *slot_name,
472  float r_mat[3][3]);
473 
474 void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, const char htype, const short oflag);
475 
477  BMOpSlot *slot_vert_map,
478  BMOpSlot *slot_edge_map,
479  BMOpSlot *slot_face_map,
480  const bool check_select);
481 
482 /* copies the values from another slot to the end of the output slot */
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,
489  BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS],
490  const char *slot_name_src,
491  struct MemArena *arena_dst);
492 
493 /* puts every element of type 'type' (which is a bitmask) with tool
494  * flag 'flag', into a slot. */
496  BMOperator *op,
497  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
498  const char *slot_name,
499  const char htype,
500  const short oflag);
501 
502 /* puts every element of type 'type' (which is a bitmask) without tool
503  * flag 'flag', into a slot. */
505  BMOperator *op,
506  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
507  const char *slot_name,
508  const char htype,
509  const short oflag);
510 
511 /* tool-flags all elements inside an element slot array with flag flag. */
513  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
514  const char *slot_name,
515  const char htype,
516  const short oflag);
517 /* clears tool-flag flag from all elements inside a slot array. */
519  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
520  const char *slot_name,
521  const char htype,
522  const short oflag);
523 
524 /* tool-flags all elements inside an element slot array with flag flag. */
526  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
527  const char *slot_name,
528  const char htype,
529  const char hflag,
530  const bool do_flush);
531 /* clears tool-flag flag from all elements inside a slot array. */
533  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
534  const char *slot_name,
535  const char htype,
536  const char hflag,
537  const bool do_flush);
538 
539 /* puts every element of type 'type' (which is a bitmask) with header
540  * flag 'flag', into a slot. note: ignores hidden elements
541  * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/
543  BMOperator *op,
544  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
545  const char *slot_name,
546  const char htype,
547  const char hflag);
548 
549 /* puts every element of type 'type' (which is a bitmask) without
550  * header flag 'flag', into a slot. note: ignores hidden elements
551  * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/
553  BMOperator *op,
554  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
555  const char *slot_name,
556  const char htype,
557  const char hflag);
558 
560  BMOpSlot *slot,
561  BMHeader **ele_buffer,
562  int ele_buffer_len);
563 
566 
567 /* counts number of elements inside a slot array. */
568 int BMO_slot_buffer_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
569 int BMO_slot_map_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
570 
571 void BMO_slot_map_insert(BMOperator *op, BMOpSlot *slot, const void *element, const void *data);
572 
573 /* flags all elements in a mapping. note that the mapping must only have
574  * bmesh elements in it.*/
576  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
577  const char *slot_name,
578  const char htype,
579  const short oflag);
580 
582  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
583  const char *slot_name,
584  const int len);
585 
587  BMOperator *op,
588  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
589  const char *slot_name,
590  const char htype);
591 
627 /* contents of this structure are private,
628  * don't directly access. */
629 typedef struct BMOIter {
631  int cur; // for arrays
633  void **val;
634  char restrictmask; /* bitwise '&' with BMHeader.htype */
636 
637 void *BMO_slot_buffer_get_first(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name);
638 
639 void *BMO_iter_new(BMOIter *iter,
640  BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
641  const char *slot_name,
642  const char restrictmask);
643 void *BMO_iter_step(BMOIter *iter);
644 
645 void **BMO_iter_map_value_p(BMOIter *iter);
646 void *BMO_iter_map_value_ptr(BMOIter *iter);
647 
648 float BMO_iter_map_value_float(BMOIter *iter);
650 bool BMO_iter_map_value_bool(BMOIter *iter);
651 
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); \
654  ele; \
655  BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_step(iter))
656 
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), \
659  i_ = 0; \
660  ele; \
661  BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BMO_iter_step(iter), i_++)
662 
664 
665 int BMO_opcode_from_opname(const char *opname);
666 
667 #ifdef __cplusplus
668 }
669 #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
void BMO_op_flag_disable(BMesh *bm, BMOperator *op, const int op_flag)
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
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_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_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)
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
BLI_INLINE short _bmo_elem_flag_test(BMesh *bm, const BMFlagLayer *oflags, const short oflag)
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_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)
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)
struct BMOperator BMOperator
int BMO_iter_map_value_int(BMOIter *iter)
#define MAX_SLOTNAME
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.
struct BMOIter BMOIter
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,...)
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_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)
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_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)
#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])
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_ONLYTAGGED
@ DEL_FACES_KEEP_BOUNDARY
@ DEL_EDGESFACES
@ DEL_EDGES
@ DEL_FACES
@ DEL_ONLYFACES
@ DEL_VERTS
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
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_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.
@ BMO_FLAG_RESPECT_HIDE
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.
@ BMO_DELIM_NORMAL
@ BMO_DELIM_MATERIAL
@ BMO_DELIM_SEAM
@ BMO_DELIM_SHARP
@ BMO_DELIM_UV
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)
Definition: btDbvt.cpp:52
char htype
Definition: bmesh_class.h:76
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
BMO_FlagSet * flags
union BMOpSlot::@139 data
struct BMOpSlot::@139::@140 enum_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
uint len