29 return (!is_select && (
is_inside)) ? 1 : -1;
35 return (is_select &&
is_inside) ? -1 : (is_select ? 0 : -1);
48 return (!is_select &&
is_inside) ? 1 : -1;
55 return (is_select &&
is_inside) ? -1 : (is_select ? 0 : -1);
66 if (is_first ==
false) {
80 return (
fabsf(delta) <= thresh);
82 return ((delta + thresh) >= 0.0f);
84 return ((delta - thresh) <= 0.0f);
99 float nearest_edge_length;
104 nearest_edge_length =
length;
111 nearest_edge_length = -1.0f;
122 KDTreeNearest_1d nearest;
123 if (BLI_kdtree_1d_find_nearest(
tree, &nearest_edge_length, &nearest) != -1) {
125 float delta =
length - nearest.co[0];
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
A KD-tree for nearest neighbor search.
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
static bool is_inside(int x, int y, int cols, int rows)
float length(VecOp< float, D >) RET
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
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)
std::string ED_select_pick_get_name(wmOperatorType *, PointerRNA *ptr)
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)
SelectPick_Params ED_select_pick_params_from_operator(PointerRNA *ptr)
std::string ED_select_circle_get_name(wmOperatorType *, PointerRNA *ptr)