diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-14 03:28:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-14 18:48:55 +0300 |
commit | e88e80a6a0c8976ac2d245c274ca5a0388736743 (patch) | |
tree | 870bc13538dfb5b55d4063cdab0aa611573dde60 /source/blender/editors/include | |
parent | d92d310b158d4b946aa8b811248b25e7a39f7a1a (diff) |
3D View boarder/lasso select tool options
Add tool options to control how select operates (add/sub/set/and/xor).
Note: edit mode armature select still needs to support all options,
this is complicated by how it handles partial end-point selection.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_particle.h | 4 | ||||
-rw-r--r-- | source/blender/editors/include/ED_sculpt.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_select_utils.h | 52 |
4 files changed, 56 insertions, 4 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index a473974eb3f..d791c055d95 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -204,7 +204,7 @@ void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEd /* editface.c */ void paintface_flush_flags(struct Object *ob, short flag); bool paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], bool extend, bool deselect, bool toggle); -int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, bool select, bool extend); +int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int sel_op); void paintface_deselect_all_visible(struct Object *ob, int action, bool flush_flags); void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], const bool select); bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]); diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index 08ed8097ea6..552975b9e55 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -62,9 +62,9 @@ void PE_update_object( /* selection tools */ int PE_mouse_particles(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); -int PE_border_select(struct bContext *C, const struct rcti *rect, bool select, bool extend); +int PE_border_select(struct bContext *C, const struct rcti *rect, const int sel_op); int PE_circle_select(struct bContext *C, int selecting, const int mval[2], float rad); -int PE_lasso_select(struct bContext *C, const int mcords[][2], const short moves, bool extend, bool select); +int PE_lasso_select(struct bContext *C, const int mcords[][2], const short moves, const int sel_op); void PE_deselect_all_visible(struct PTCacheEdit *edit); /* particle_edit_undo.c */ diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h index c624405cd0c..94508a98dcb 100644 --- a/source/blender/editors/include/ED_sculpt.h +++ b/source/blender/editors/include/ED_sculpt.h @@ -43,7 +43,7 @@ struct ListBase; /* sculpt.c */ void ED_operatortypes_sculpt(void); void ED_sculpt_redraw_planes_get(float planes[4][4], struct ARegion *ar, struct Object *ob); -int ED_sculpt_mask_box_select(struct bContext *C, struct ViewContext *vc, const struct rcti *rect, bool select, bool extend); +int ED_sculpt_mask_box_select(struct bContext *C, struct ViewContext *vc, const struct rcti *rect, bool select); /* sculpt_undo.c */ void ED_sculpt_undosys_type(struct UndoType *ut); diff --git a/source/blender/editors/include/ED_select_utils.h b/source/blender/editors/include/ED_select_utils.h new file mode 100644 index 00000000000..add1c812e1f --- /dev/null +++ b/source/blender/editors/include/ED_select_utils.h @@ -0,0 +1,52 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file ED_select_utils.h + * \ingroup editors + */ + +#ifndef __ED_SELECT_UTILS_H__ +#define __ED_SELECT_UTILS_H__ + +enum { + SEL_TOGGLE = 0, + SEL_SELECT = 1, + SEL_DESELECT = 2, + SEL_INVERT = 3, +}; + +/** See #WM_operator_properties_select_operation */ +typedef enum { + SEL_OP_ADD = 1, + SEL_OP_SUB, + SEL_OP_SET, + SEL_OP_AND, + SEL_OP_XOR, +} eSelectOp; + +#define SEL_OP_USE_OUTSIDE(sel_op) (ELEM(sel_op, SEL_OP_AND)) +#define SEL_OP_USE_PRE_DESELECT(sel_op) (ELEM(sel_op, SEL_OP_SET)) +#define SEL_OP_CAN_DESELECT(sel_op) (!ELEM(sel_op, SEL_OP_ADD)) + +/* Use when we've de-selected all first for 'SEL_OP_SET' */ +int ED_select_op_action(const eSelectOp sel_op, const bool is_select, const bool is_inside); +int ED_select_op_action_deselected(const eSelectOp sel_op, const bool is_select, const bool is_inside); + +#endif /* __ED_SELECT_UTILS_H__ */ |