diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-14 10:22:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-14 10:22:34 +0400 |
commit | da5e0ea8fe1cb85c5d0ba3b974a0520a8917ac30 (patch) | |
tree | d807b3d44fd7851ed68988e7608d988ea82ef12d /source/blender/bmesh/intern/bmesh_operator_api.h | |
parent | ba283d6c9be1d678210e08233916268f48ef4ee1 (diff) |
bmesh operators: use operator type-flag to specify which operations require normal-calculations and which operations require selection flushing.
eg, no need to flush selection after 'Smooth' tool, no need to recalculate normals after 'Select Similar'.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operator_api.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operator_api.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index c72accbc605..ccc90172d7a 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -178,13 +178,21 @@ typedef struct BMOpSlot { /* way more than probably needed, compiler complains if limit hit */ #define BMO_OP_MAX_SLOTS 16 +/* BMOpDefine->type_flag */ +typedef enum { + BMO_OPTYPE_FLAG_NOP = 0, + BMO_OPTYPE_FLAG_UNTAN_MULTIRES = (1 << 0), /* switch from multires tangent space to absolute coordinates */ + BMO_OPTYPE_FLAG_NORMALS_CALC = (1 << 1), /*switch from multires tangent space to absolute coordinates*/ + BMO_OPTYPE_FLAG_SELECT_FLUSH = (1 << 2) /*switch from multires tangent space to absolute coordinates*/ +} BMOpTypeFlag; + typedef struct BMOperator { struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]; struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]; void (*exec)(BMesh *bm, struct BMOperator *op); struct MemArena *arena; int type; - int type_flag; + BMOpTypeFlag type_flag; int flag; /* runtime options */ } BMOperator; @@ -207,14 +215,9 @@ typedef struct BMOpDefine { BMOSlotType slot_types_in[BMO_OP_MAX_SLOTS]; BMOSlotType slot_types_out[BMO_OP_MAX_SLOTS]; void (*exec)(BMesh *bm, BMOperator *op); - int type_flag; + BMOpTypeFlag type_flag; } BMOpDefine; -/* BMOpDefine->type_flag */ -enum { - BMO_OP_FLAG_UNTAN_MULTIRES = 1 /*switch from multires tangent space to absolute coordinates*/ -}; - /*------------- Operator API --------------*/ /* data types that use pointers (arrays, etc) should never |