34 return (!is_select && (
is_inside)) ? 1 : -1;
40 return (is_select &&
is_inside) ? -1 : (is_select ? 0 : -1);
59 return (!is_select &&
is_inside) ? 1 : -1;
66 return (is_select &&
is_inside) ? -1 : (is_select ? 0 : -1);
80 if (is_first ==
false) {
91 return (
fabsf(delta) <= thresh);
93 return ((delta + thresh) >= 0.0);
95 return ((delta - thresh) <= 0.0);
108 float nearest_edge_length;
113 nearest_edge_length =
length;
120 nearest_edge_length = -1.0f;
124 nearest_edge_length = FLT_MAX;
131 KDTreeNearest_1d nearest;
132 if (BLI_kdtree_1d_find_nearest(
tree, &nearest_edge_length, &nearest) != -1) {
133 float delta =
length - nearest.co[0];
#define BLI_assert_unreachable()
A kd-tree for nearest neighbor search.
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
static bool is_inside(int x, int y, int cols, int rows)
int ED_select_similar_compare_float(const float delta, const float thresh, const int compare)
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)
int ED_select_op_action_deselected(const eSelectOp sel_op, const bool is_select, const bool is_inside)
bool ED_select_similar_compare_float_tree(const KDTree_1d *tree, const float length, const float thresh, const int compare)