Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
ED_select_utils.h File Reference
#include "BLI_compiler_attrs.h"

Go to the source code of this file.

Classes

struct  SelectPick_Params
 

Macros

#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))
 

Typedefs

typedef enum WalkSelectDirection WalkSelectDirections
 

Enumerations

enum  { SEL_TOGGLE = 0 , SEL_SELECT = 1 , SEL_DESELECT = 2 , SEL_INVERT = 3 }
 
enum  WalkSelectDirection { UI_SELECT_WALK_UP , UI_SELECT_WALK_DOWN , UI_SELECT_WALK_LEFT , UI_SELECT_WALK_RIGHT }
 
enum  eSelectOp {
  SEL_OP_ADD = 1 , SEL_OP_SUB , SEL_OP_SET , SEL_OP_AND ,
  SEL_OP_XOR
}
 
enum  eSimilarCmp { SIM_CMP_EQ = 0 , SIM_CMP_GT , SIM_CMP_LT }
 

Functions

int ED_select_op_action (eSelectOp sel_op, bool is_select, bool is_inside)
 
int ED_select_op_action_deselected (eSelectOp sel_op, bool is_select, bool is_inside)
 
bool ED_select_similar_compare_float (float delta, float thresh, eSimilarCmp compare)
 
bool ED_select_similar_compare_float_tree (const struct KDTree_1d *tree, float length, float thresh, eSimilarCmp compare)
 
eSelectOp ED_select_op_modal (eSelectOp sel_op, bool is_first)
 
eSelectOp ED_select_op_from_operator (struct PointerRNA *ptr) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
 
void ED_select_pick_params_from_operator (struct PointerRNA *ptr, struct SelectPick_Params *params) ATTR_NONNULL(1
 
void const char * ED_select_pick_get_name (struct wmOperatorType *ot, PointerRNA *ptr)
 
const char * ED_select_circle_get_name (struct wmOperatorType *ot, PointerRNA *ptr)
 

Macro Definition Documentation

◆ SEL_OP_CAN_DESELECT

#define SEL_OP_CAN_DESELECT (   sel_op)    (!ELEM(sel_op, SEL_OP_ADD))

Definition at line 51 of file ED_select_utils.h.

◆ SEL_OP_USE_OUTSIDE

#define SEL_OP_USE_OUTSIDE (   sel_op)    (ELEM(sel_op, SEL_OP_AND))

Definition at line 49 of file ED_select_utils.h.

◆ SEL_OP_USE_PRE_DESELECT

#define SEL_OP_USE_PRE_DESELECT (   sel_op)    (ELEM(sel_op, SEL_OP_SET))

Definition at line 50 of file ED_select_utils.h.

Typedef Documentation

◆ WalkSelectDirections

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEL_TOGGLE 
SEL_SELECT 
SEL_DESELECT 
SEL_INVERT 

Definition at line 19 of file ED_select_utils.h.

◆ eSelectOp

enum eSelectOp

See WM_operator_properties_select_operation

Enumerator
SEL_OP_ADD 
SEL_OP_SUB 
SEL_OP_SET 
SEL_OP_AND 
SEL_OP_XOR 

Definition at line 34 of file ED_select_utils.h.

◆ eSimilarCmp

Enumerator
SIM_CMP_EQ 
SIM_CMP_GT 
SIM_CMP_LT 

Definition at line 43 of file ED_select_utils.h.

◆ WalkSelectDirection

Enumerator
UI_SELECT_WALK_UP 
UI_SELECT_WALK_DOWN 
UI_SELECT_WALK_LEFT 
UI_SELECT_WALK_RIGHT 

Definition at line 26 of file ED_select_utils.h.

Function Documentation

◆ ED_select_circle_get_name()

const char* ED_select_circle_get_name ( struct wmOperatorType ot,
PointerRNA ptr 
)

◆ ED_select_op_action()

int ED_select_op_action ( eSelectOp  sel_op,
bool  is_select,
bool  is_inside 
)

Use when we've de-selected all first for 'SEL_OP_SET'. 1: select, 0: deselect, -1: pass.

Definition at line 21 of file select_utils.c.

References BLI_assert_msg, is_inside(), SEL_OP_ADD, SEL_OP_AND, SEL_OP_SET, SEL_OP_SUB, and SEL_OP_XOR.

◆ ED_select_op_action_deselected()

int ED_select_op_action_deselected ( eSelectOp  sel_op,
bool  is_select,
bool  is_inside 
)

◆ ED_select_op_from_operator()

eSelectOp ED_select_op_from_operator ( struct PointerRNA ptr)

Utility to get #eSelectPickMode from booleans for convenience.

Definition at line 128 of file select_utils.c.

References ptr, RNA_boolean_get(), SEL_OP_ADD, SEL_OP_SET, SEL_OP_SUB, and SEL_OP_XOR.

Referenced by bone_select_menu_exec(), and ED_select_pick_params_from_operator().

◆ ED_select_op_modal()

eSelectOp ED_select_op_modal ( eSelectOp  sel_op,
bool  is_first 
)

Utility to use for selection operations that run multiple times (circle select).

Definition at line 59 of file select_utils.c.

References SEL_OP_ADD, and SEL_OP_SET.

Referenced by action_circle_select_exec(), circle_select_exec(), gpencil_circle_select_exec(), graph_circle_select_exec(), blender::ed::space_node::node_circleselect_exec(), uv_circle_select_exec(), and view3d_circle_select_exec().

◆ ED_select_pick_get_name()

void const char* ED_select_pick_get_name ( struct wmOperatorType ot,
PointerRNA ptr 
)

Get-name callback for wmOperatorType.get_name, this is mainly useful so the selection action is shown in the status-bar.

Referenced by GPENCIL_OT_select(), MASK_OT_select(), blender::ed::space_node::NODE_OT_select(), SEQUENCER_OT_select(), UV_OT_select(), and VIEW3D_OT_select().

◆ ED_select_pick_params_from_operator()

void ED_select_pick_params_from_operator ( struct PointerRNA ptr,
struct SelectPick_Params params 
)

Initialize params from op, these properties are defined by WM_operator_properties_mouse_select.

Referenced by blender::ed::space_node::node_select_exec(), uv_select_exec(), and view3d_select_exec().

◆ ED_select_similar_compare_float()

bool ED_select_similar_compare_float ( float  delta,
float  thresh,
eSimilarCmp  compare 
)

◆ ED_select_similar_compare_float_tree()

bool ED_select_similar_compare_float_tree ( const struct KDTree_1d *  tree,
float  length,
float  thresh,
eSimilarCmp  compare 
)