diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-19 18:58:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-19 18:58:31 +0400 |
commit | 48639af5f89e08e81cd68fce0a7138007d4ebe1d (patch) | |
tree | 54df28f67a3222efed63e145b06f8773dc2165ed /source/blender/bmesh/intern/bmesh_operator_api_inline.h | |
parent | 312abf8cb236b72e3e20ce8850da7448897f6aa9 (diff) |
use input and output slots for bmesh operators, needed for the python api to get return values.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operator_api_inline.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operator_api_inline.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operator_api_inline.h b/source/blender/bmesh/intern/bmesh_operator_api_inline.h index 16c2b8b0505..7f7b27c693a 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api_inline.h +++ b/source/blender/bmesh/intern/bmesh_operator_api_inline.h @@ -69,16 +69,18 @@ BLI_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const shor oflags[bm->stackdepth - 1].f ^= oflag; } -BLI_INLINE void BMO_slot_map_int_insert(BMesh *bm, BMOperator *op, const char *slot_name, +BLI_INLINE void BMO_slot_map_int_insert(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], + const char *slot_name, void *element, int val) { - BMO_slot_map_insert(bm, op, slot_name, element, &val, sizeof(int)); + BMO_slot_map_insert(op, slot_args, slot_name, element, &val, sizeof(int)); } -BLI_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char *slot_name, +BLI_INLINE void BMO_slot_map_float_insert(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], + const char *slot_name, void *element, float val) { - BMO_slot_map_insert(bm, op, slot_name, element, &val, sizeof(float)); + BMO_slot_map_insert(op, slot_args, slot_name, element, &val, sizeof(float)); } @@ -87,15 +89,16 @@ BLI_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char * do NOT use these for non-operator-api-allocated memory! instead * use BMO_slot_map_data_get and BMO_slot_map_insert, which copies the data. */ -BLI_INLINE void BMO_slot_map_ptr_insert(BMesh *bm, BMOperator *op, const char *slot_name, +BLI_INLINE void BMO_slot_map_ptr_insert(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], + const char *slot_name, void *element, void *val) { - BMO_slot_map_insert(bm, op, slot_name, element, &val, sizeof(void *)); + BMO_slot_map_insert(op, slot_args, slot_name, element, &val, sizeof(void *)); } -BLI_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const char *slot_name, void *element) +BLI_INLINE int BMO_slot_map_contains(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *element) { - BMOpSlot *slot = BMO_slot_get(op, slot_name); + BMOpSlot *slot = BMO_slot_get(slot_args, slot_name); BLI_assert(slot->slot_type == BMO_OP_SLOT_MAPPING); /* sanity check */ @@ -104,11 +107,11 @@ BLI_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const ch return BLI_ghash_haskey(slot->data.ghash, element); } -BLI_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const char *slot_name, +BLI_INLINE void *BMO_slot_map_data_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *element) { BMOElemMapping *mapping; - BMOpSlot *slot = BMO_slot_get(op, slot_name); + BMOpSlot *slot = BMO_slot_get(slot_args, slot_name); BLI_assert(slot->slot_type == BMO_OP_SLOT_MAPPING); /* sanity check */ @@ -121,28 +124,28 @@ BLI_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const return mapping + 1; } -BLI_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *slot_name, +BLI_INLINE float BMO_slot_map_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *element) { - float *val = (float *) BMO_slot_map_data_get(bm, op, slot_name, element); + float *val = (float *) BMO_slot_map_data_get(slot_args, slot_name, element); if (val) return *val; return 0.0f; } -BLI_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slot_name, +BLI_INLINE int BMO_slot_map_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *element) { - int *val = (int *) BMO_slot_map_data_get(bm, op, slot_name, element); + int *val = (int *) BMO_slot_map_data_get(slot_args, slot_name, element); if (val) return *val; return 0; } -BLI_INLINE void *BMO_slot_map_ptr_get(BMesh *bm, BMOperator *op, const char *slot_name, +BLI_INLINE void *BMO_slot_map_ptr_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *element) { - void **val = (void **) BMO_slot_map_data_get(bm, op, slot_name, element); + void **val = (void **) BMO_slot_map_data_get(slot_args, slot_name, element); if (val) return *val; return NULL; |