42 for (
int i = 0; i < spline->
tot_point; i++) {
88 for (
int i = 0; i < spline->
tot_point; i++) {
98 if (do_select ==
true) {
133 for (
int i = 0; i < spline.
tot_point; i++) {
157 for (
int i = 0; i < spline.
tot_point; i++) {
166 for (j = 0; j < cur_point->
tot_uw; j++) {
217 ot->
name =
"(De)select All";
218 ot->
description =
"Change selection of all curve points";
219 ot->
idname =
"MASK_OT_select_all";
250 const float threshold = 19;
258 C,
mask, co, threshold, &mask_layer, &spline, &which_handle,
nullptr);
260 if (extend ==
false && deselect ==
false && toggle ==
false) {
326 C,
mask, co, threshold, &mask_layer, &spline, &point, &uw,
nullptr))
395 ot->
idname =
"MASK_OT_select";
416 "Location of vertex in normalized space",
438 bool changed =
false;
455 *mask_layer_eval = mask_eval->
masklayers.first();
456 mask_layer_orig !=
nullptr;
457 mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next)
462 for (
MaskSpline *spline_orig = mask_layer_orig->splines.first(),
463 *spline_eval = mask_layer_eval->splines.first();
464 spline_orig !=
nullptr;
465 spline_orig = spline_orig->
next, spline_eval = spline_eval->
next)
470 for (
int i = 0; i < spline_orig->tot_point; i++) {
500 ot->
name =
"Box Select";
501 ot->
description =
"Select curve points using box selection";
502 ot->
idname =
"MASK_OT_select_box";
534 bool changed =
false;
547 *mask_layer_eval = mask_eval->
masklayers.first();
548 mask_layer_orig !=
nullptr;
549 mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next)
554 for (
MaskSpline *spline_orig = mask_layer_orig->splines.first(),
555 *spline_eval = mask_layer_eval->splines.first();
556 spline_orig !=
nullptr;
557 spline_orig = spline_orig->
next, spline_eval = spline_eval->
next)
562 for (
int i = 0; i < spline_orig->tot_point; i++) {
620 ot->
name =
"Lasso Select";
621 ot->
description =
"Select curve points using lasso selection";
622 ot->
idname =
"MASK_OT_select_lasso";
646 const float offset[2],
647 const float ellipse[2])
652 x = (bezt->
vec[1][0] - offset[0]) * ellipse[0];
653 y = (bezt->
vec[1][1] - offset[1]) * ellipse[1];
655 return x *
x +
y *
y < 1.0f;
667 float zoomx, zoomy, offset[2], ellipse[2];
669 bool changed =
false;
679 width = height =
max_ii(width, height);
681 ellipse[0] = width * zoomx / radius;
682 ellipse[1] = height * zoomy / radius;
697 *mask_layer_eval = mask_eval->
masklayers.first();
698 mask_layer_orig !=
nullptr;
699 mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next)
704 for (
MaskSpline *spline_orig = mask_layer_orig->splines.first(),
705 *spline_eval = mask_layer_eval->splines.first();
706 spline_orig !=
nullptr;
707 spline_orig = spline_orig->
next, spline_eval = spline_eval->
next)
712 for (
int i = 0; i < spline_orig->tot_point; i++) {
741 ot->
name =
"Circle Select";
742 ot->
description =
"Select curve points using circle selection";
743 ot->
idname =
"MASK_OT_select_circle";
779 const float threshold = 19;
780 bool changed =
false;
785 C,
mask, co, threshold, &mask_layer, &spline,
nullptr,
nullptr);
810 ot->
name =
"Select Linked";
811 ot->
idname =
"MASK_OT_select_linked_pick";
812 ot->
description =
"(De)select all points linked to the curve under the mouse cursor";
834 bool changed =
false;
865 ot->
name =
"Select Linked All";
866 ot->
idname =
"MASK_OT_select_linked";
867 ot->
description =
"Select all curve points linked to already selected ones";
894 bool start_sel, end_sel, prev_sel, cur_sel;
897 for (
int i = 0; i < spline.
tot_point; i++) {
915 for (
int i = 0; i < spline.
tot_point; i++) {
916 if (i == 0 && !cyclic) {
923 if (cur_sel != more) {
924 if (prev_sel == more) {
931 for (
int i = spline.
tot_point - 1; i >= 0; i--) {
932 if (i == spline.
tot_point - 1 && !cyclic) {
941 if (cur_sel != more) {
942 if (prev_sel == more) {
965 ot->
name =
"Select More";
966 ot->
idname =
"MASK_OT_select_more";
967 ot->
description =
"Select more spline points connected to initial selection";
985 ot->
name =
"Select Less";
986 ot->
idname =
"MASK_OT_select_less";
987 ot->
description =
"Deselect spline points at the boundary of each selection region";
#define SEL_OP_USE_PRE_DESELECT(sel_op)
static int mask_spline_point_inside_ellipse(BezTriple *bezt, const float offset[2], const float ellipse[2])
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
std::string ED_select_circle_get_name(wmOperatorType *ot, PointerRNA *ptr)
ScrArea * CTX_wm_area(const bContext *C)
void BKE_mask_point_select_set_handle(MaskSplinePoint *point, eMaskWhichHandle which_handle, bool do_select)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
int RNA_enum_get(PointerRNA *ptr, const char *name)
static wmOperatorStatus mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_operator_flag_only_pass_through_on_press(wmOperatorStatus retval, const wmEvent *event)
eSelectOp ED_select_op_modal(eSelectOp sel_op, bool is_first)
void MASK_OT_select_box(wmOperatorType *ot)
static wmOperatorStatus circle_select_exec(bContext *C, wmOperator *op)
void ED_mask_select_toggle_all(Mask *mask, int action)
void ED_mask_view_lock_state_store(const bContext *C, MaskViewLockState *state)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
static wmOperatorStatus select_exec(bContext *C, wmOperator *op)
int RNA_int_get(PointerRNA *ptr, const char *name)
MaskSplinePoint * ED_mask_point_find_nearest(const bContext *C, Mask *mask_orig, const float normal_co[2], float threshold, MaskLayer **r_mask_layer, MaskSpline **r_spline, eMaskWhichHandle *r_which_handle, float *r_score)
MINLINE int max_ii(int a, int b)
wmOperatorStatus WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void ED_mask_zoom(ScrArea *area, ARegion *region, float *r_zoomx, float *r_zoomy)
bool BLI_lasso_is_point_inside(Span< int2 > mcoords, int sx, int sy, int error_value)
void MASK_OT_select_circle(wmOperatorType *ot)
void ED_mask_point_pos__reverse(ScrArea *area, ARegion *region, float x, float y, float *r_x, float *r_y)
void WM_operator_properties_select_all(wmOperatorType *ot)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void MASK_OT_select(wmOperatorType *ot)
static wmOperatorStatus clip_lasso_select_exec(bContext *C, wmOperator *op)
bool ED_mask_spline_select_check(const MaskSpline *spline)
bool BKE_mask_point_selected(const MaskSplinePoint *p)
void DEG_id_tag_update(ID *id, unsigned int flags)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
static wmOperatorStatus mask_select_more_exec(bContext *C, wmOperator *)
void ED_mask_deselect_all(const bContext *C)
void WM_operator_properties_border_to_rcti(wmOperator *op, rcti *r_rect)
void MASK_OT_select_less(wmOperatorType *ot)
wmOperatorStatus WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool ED_mask_select_check(const Mask *mask)
void WM_operator_properties_mouse_select(wmOperatorType *ot)
void MASK_OT_select_linked_pick(wmOperatorType *ot)
void BKE_mask_point_select_set(MaskSplinePoint *point, bool do_select)
bool BKE_mask_point_is_handle_selected(const MaskSplinePoint *point, eMaskWhichHandle handle)
void ED_mask_get_size(ScrArea *area, int *r_width, int *r_height)
bool BKE_mask_point_selected_knot(const MaskSplinePoint *p)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
Mask * CTX_data_edit_mask(const bContext *C)
void ED_mask_select_flush_all(Mask *mask)
void ED_mask_view_lock_state_restore_no_jump(const bContext *C, const MaskViewLockState *state)
static wmOperatorStatus select_all_exec(bContext *C, wmOperator *op)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool ED_maskedit_mask_visible_splines_poll(bContext *C)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
void ED_mask_layer_select_set(MaskLayer *mask_layer, bool do_select)
void MASK_OT_select_all(wmOperatorType *ot)
void MASK_OT_select_lasso(wmOperatorType *ot)
void MASK_OT_select_more(wmOperatorType *ot)
wmOperatorStatus WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *r_x, float *r_y)
void ED_mask_spline_select_set(MaskSpline *spline, bool do_select)
Array< int2 > WM_gesture_lasso_path_to_array(bContext *, wmOperator *op)
static wmOperatorStatus mask_select_less_exec(bContext *C, wmOperator *)
void MASK_OT_select_linked(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
static bool do_lasso_select_mask(bContext *C, const Span< int2 > mcoords, const eSelectOp sel_op)
@ OPTYPE_DEPENDS_ON_CURSOR
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
static wmOperatorStatus select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool ED_mask_layer_select_check(const MaskLayer *mask_layer)
bool WM_gesture_is_modal_first(const wmGesture *gesture)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float r_co[2])
wmOperatorStatus WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
MaskSplinePoint * BKE_mask_spline_point_array(MaskSpline *spline)
std::string ED_select_pick_get_name(wmOperatorType *ot, PointerRNA *ptr)
ARegion * CTX_wm_region(const bContext *C)
void BLI_lasso_boundbox(rcti *rect, Span< int2 > mcoords)
static wmOperatorStatus mask_select_more_less(bContext *C, bool more)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
static wmOperatorStatus mask_select_linked_exec(bContext *C, wmOperator *)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
static wmOperatorStatus box_select_exec(bContext *C, wmOperator *op)
bool ED_mask_feather_find_nearest(const bContext *C, Mask *mask_orig, const float normal_co[2], float threshold, MaskLayer **r_mask_layer, MaskSpline **r_spline, MaskSplinePoint **r_point, MaskSplinePointUW **r_uw, float *r_score)
struct MaskSplinePoint * act_point
struct MaskSpline * act_spline
MaskLayerVisibility visibility_flag
ListBaseT< MaskSpline > splines
ListBaseT< struct MaskLayer > masklayers
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) cancel(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
std::string(*) get_name(wmOperatorType *ot, PointerRNA *ptr)