25 return (!is_select && (
is_inside)) ? 1 : -1;
31 return (is_select &&
is_inside) ? -1 : (is_select ? 0 : -1);
44 return (!is_select &&
is_inside) ? 1 : -1;
51 return (is_select &&
is_inside) ? -1 : (is_select ? 0 : -1);
62 if (is_first ==
false) {
76 return (
fabsf(delta) <= thresh);
78 return ((delta + thresh) >= 0.0f);
80 return ((delta - thresh) <= 0.0f);
95 float nearest_edge_length;
100 nearest_edge_length =
length;
107 nearest_edge_length = -1.0f;
111 nearest_edge_length = FLT_MAX;
118 KDTreeNearest_1d nearest;
119 if (BLI_kdtree_1d_find_nearest(
tree, &nearest_edge_length, &nearest) != -1) {
121 float delta =
length - nearest.co[0];
164 return "Select (Extend)";
166 return "Select (Deselect)";
168 return "Select (Toggle)";
184 return "Circle Select (Extend)";
186 return "Circle Select (Deselect)";
195 return "Circle Select";
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
A KD-tree for nearest neighbor search.
static bool is_inside(int x, int y, int cols, int rows)
T length(const vec_base< T, Size > &a)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const char * ED_select_pick_get_name(wmOperatorType *UNUSED(ot), PointerRNA *ptr)
bool ED_select_similar_compare_float(const float delta, const float thresh, const eSimilarCmp compare)
bool ED_select_similar_compare_float_tree(const KDTree_1d *tree, const float length, const float thresh, const eSimilarCmp compare)
const char * ED_select_circle_get_name(wmOperatorType *UNUSED(ot), PointerRNA *ptr)
void ED_select_pick_params_from_operator(PointerRNA *ptr, struct SelectPick_Params *params)
int ED_select_op_action(const eSelectOp sel_op, const bool is_select, const bool is_inside)
eSelectOp ED_select_op_modal(const eSelectOp sel_op, const bool is_first)
eSelectOp ED_select_op_from_operator(PointerRNA *ptr)
int ED_select_op_action_deselected(const eSelectOp sel_op, const bool is_select, const bool is_inside)