61 for (
int i = 0; i < spline->
tot_point; i++) {
108 for (
int i = 0; i < spline->
tot_point; i++) {
118 if (do_select ==
true) {
153 for (
int i = 0; i < spline->tot_point; i++) {
177 for (
int i = 0; i < spline->tot_point; i++) {
186 for (j = 0; j < cur_point->
tot_uw; j++) {
237 ot->
name =
"(De)select All";
270 const float threshold = 19;
278 C,
mask, co, threshold, &mask_layer, &spline, &which_handle,
NULL);
280 if (extend ==
false && deselect ==
false && toggle ==
false) {
346 C,
mask, co, threshold, &mask_layer, &spline, &point, &uw,
NULL)) {
435 "Location of vertex in normalized space",
457 bool changed =
false;
475 mask_layer_orig !=
NULL;
476 mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) {
480 for (
MaskSpline *spline_orig = mask_layer_orig->splines.first,
481 *spline_eval = mask_layer_eval->splines.first;
483 spline_orig = spline_orig->next, spline_eval = spline_eval->next) {
487 for (
int i = 0; i < spline_orig->tot_point; i++) {
542 const int mcoords[][2],
543 const int mcoords_len,
554 bool changed =
false;
568 mask_layer_orig !=
NULL;
569 mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) {
573 for (
MaskSpline *spline_orig = mask_layer_orig->splines.first,
574 *spline_eval = mask_layer_eval->splines.first;
576 spline_orig = spline_orig->next, spline_eval = spline_eval->next) {
580 for (
int i = 0; i < spline_orig->tot_point; i++) {
640 ot->
name =
"Lasso Select";
641 ot->
description =
"Select curve points using lasso selection";
642 ot->
idname =
"MASK_OT_select_lasso";
666 const float offset[2],
667 const float ellipse[2])
672 x = (bezt->
vec[1][0] - offset[0]) * ellipse[0];
673 y = (bezt->
vec[1][1] - offset[1]) * ellipse[1];
675 return x *
x +
y *
y < 1.0f;
687 float zoomx, zoomy, offset[2], ellipse[2];
689 bool changed =
false;
701 ellipse[0] =
width * zoomx / radius;
702 ellipse[1] =
height * zoomy / radius;
717 mask_layer_orig !=
NULL;
718 mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) {
722 for (
MaskSpline *spline_orig = mask_layer_orig->splines.first,
723 *spline_eval = mask_layer_eval->splines.first;
725 spline_orig = spline_orig->next, spline_eval = spline_eval->next) {
729 for (
int i = 0; i < spline_orig->tot_point; i++) {
758 ot->
name =
"Circle Select";
759 ot->
description =
"Select curve points using circle selection";
760 ot->
idname =
"MASK_OT_select_circle";
793 const float threshold = 19;
794 bool changed =
false;
823 ot->
name =
"Select Linked";
824 ot->
idname =
"MASK_OT_select_linked_pick";
825 ot->
description =
"(De)select all points linked to the curve under the mouse cursor";
847 bool changed =
false;
878 ot->
name =
"Select Linked All";
879 ot->
idname =
"MASK_OT_select_linked";
880 ot->
description =
"Select all curve points linked to already selected ones";
907 bool start_sel, end_sel, prev_sel, cur_sel;
910 for (
int i = 0; i < spline->tot_point; i++) {
915 if (spline->tot_point < 2) {
928 for (
int i = 0; i < spline->tot_point; i++) {
929 if (i == 0 && !cyclic) {
936 if (cur_sel != more) {
937 if (prev_sel == more) {
944 for (
int i = spline->tot_point - 1; i >= 0; i--) {
945 if (i == spline->tot_point - 1 && !cyclic) {
953 if (cur_sel != more) {
954 if (prev_sel == more) {
979 ot->
description =
"Select more spline points connected to initial selection";
999 ot->
description =
"Deselect spline points at the boundary of each selection region";
struct ScrArea * CTX_wm_area(const bContext *C)
struct Mask * CTX_data_edit_mask(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
#define MASKPOINT_ISSEL_ANY(p)
void BKE_mask_point_select_set(struct MaskSplinePoint *point, const bool do_select)
#define MASKPOINT_ISSEL_KNOT(p)
#define MASKPOINT_ISSEL_HANDLE(point, which_handle)
struct MaskSplinePoint * BKE_mask_spline_point_array(struct MaskSpline *spline)
void BKE_mask_point_select_set_handle(struct MaskSplinePoint *point, const eMaskWhichHandle which_handle, const bool do_select)
void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], const unsigned int mcoords_len)
bool BLI_lasso_is_point_inside(const int mcoords[][2], const unsigned int mcoords_len, const int sx, const int sy, const int error_value)
#define LISTBASE_FOREACH(type, var, list)
MINLINE int max_ii(int a, int b)
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
bool BLI_rcti_isect_pt(const struct rcti *rect, const int x, const int y)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
struct ID * DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id)
#define MASK_RESTRICT_SELECT
#define MASK_RESTRICT_VIEW
bool ED_clip_can_select(struct bContext *C)
void ED_mask_zoom(struct ScrArea *area, struct ARegion *region, float *zoomx, float *zoomy)
void ED_mask_point_pos__reverse(struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr)
void ED_mask_mouse_pos(struct ScrArea *area, struct ARegion *region, const int mval[2], float co[2])
void ED_mask_point_pos(struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr)
void ED_mask_get_size(struct ScrArea *area, int *width, int *height)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
eSelectOp ED_select_op_modal(const eSelectOp sel_op, const bool is_first)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
const Depsgraph * depsgraph
void(* MEM_freeN)(void *vmemh)
void ED_mask_view_lock_state_restore_no_jump(const bContext *C, const MaskViewLockState *state)
bool ED_maskedit_mask_poll(bContext *C)
void ED_mask_view_lock_state_store(const bContext *C, MaskViewLockState *state)
struct MaskSplinePoint * ED_mask_point_find_nearest(const struct bContext *C, struct Mask *mask, const float normal_co[2], const float threshold, struct MaskLayer **r_mask_layer, struct MaskSpline **r_spline, eMaskWhichHandle *r_which_handle, float *r_score)
bool ED_mask_feather_find_nearest(const struct bContext *C, struct Mask *mask, const float normal_co[2], const float threshold, struct MaskLayer **r_mask_layer, struct MaskSpline **r_spline, struct MaskSplinePoint **r_point, struct MaskSplinePointUW **r_uw, float *r_score)
void MASK_OT_select_circle(wmOperatorType *ot)
static int mask_select_more_less(bContext *C, bool more)
static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool ED_mask_spline_select_check(const MaskSpline *spline)
static int select_exec(bContext *C, wmOperator *op)
void MASK_OT_select_more(wmOperatorType *ot)
static int select_all_exec(bContext *C, wmOperator *op)
static int box_select_exec(bContext *C, wmOperator *op)
void MASK_OT_select(wmOperatorType *ot)
bool ED_mask_select_check(const Mask *mask)
static int mask_spline_point_inside_ellipse(BezTriple *bezt, const float offset[2], const float ellipse[2])
static int clip_lasso_select_exec(bContext *C, wmOperator *op)
static int mask_select_less_exec(bContext *C, wmOperator *UNUSED(op))
void ED_mask_layer_select_set(MaskLayer *mask_layer, const bool do_select)
static int mask_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
void MASK_OT_select_less(wmOperatorType *ot)
static int circle_select_exec(bContext *C, wmOperator *op)
void ED_mask_spline_select_set(MaskSpline *spline, const bool do_select)
void MASK_OT_select_linked(wmOperatorType *ot)
bool ED_mask_layer_select_check(const MaskLayer *mask_layer)
void MASK_OT_select_box(wmOperatorType *ot)
void ED_mask_select_flush_all(Mask *mask)
void MASK_OT_select_all(wmOperatorType *ot)
void MASK_OT_select_lasso(wmOperatorType *ot)
static bool do_lasso_select_mask(bContext *C, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
void ED_mask_select_toggle_all(Mask *mask, int action)
void ED_mask_deselect_all(const bContext *C)
static int mask_select_more_exec(bContext *C, wmOperator *UNUSED(op))
static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void MASK_OT_select_linked_pick(wmOperatorType *ot)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
struct MaskSplinePoint * act_point
struct MaskSpline * act_spline
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool WM_gesture_is_modal_first(const wmGesture *gesture)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const int(* WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *r_mcoords_len))[2]
void WM_operator_properties_border_to_rcti(struct wmOperator *op, rcti *rect)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
void WM_operator_properties_mouse_select(wmOperatorType *ot)