Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_select.c
| Show First 20 Lines • Show All 964 Lines • ▼ Show 20 Lines | if (deselect_all) { | ||||
| data.select_flag = BEZT_FLAG_TEMP_TAG; | data.select_flag = BEZT_FLAG_TEMP_TAG; | ||||
| } | } | ||||
| ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ | ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ | ||||
| nurbs_foreachScreenVert(vc, do_lasso_select_curve__doSelect, &data, V3D_PROJ_TEST_CLIP_DEFAULT); | nurbs_foreachScreenVert(vc, do_lasso_select_curve__doSelect, &data, V3D_PROJ_TEST_CLIP_DEFAULT); | ||||
| /* Deselect items that were not added to selection (indicated by temp flag). */ | /* Deselect items that were not added to selection (indicated by temp flag). */ | ||||
| if (deselect_all) { | if (deselect_all) { | ||||
| BKE_nurbList_flag_set_from_flag(nurbs, BEZT_FLAG_TEMP_TAG, SELECT); | data.is_changed |= BKE_nurbList_flag_set_from_flag(nurbs, BEZT_FLAG_TEMP_TAG, SELECT); | ||||
| } | } | ||||
| if (data.is_changed) { | if (data.is_changed) { | ||||
| BKE_curve_nurb_vert_active_validate(vc->obedit->data); | BKE_curve_nurb_vert_active_validate(vc->obedit->data); | ||||
| } | } | ||||
| return data.is_changed; | return data.is_changed; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,785 Lines • ▼ Show 20 Lines | if (deselect_all) { | ||||
| data.select_flag = BEZT_FLAG_TEMP_TAG; | data.select_flag = BEZT_FLAG_TEMP_TAG; | ||||
| } | } | ||||
| ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ | ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ | ||||
| nurbs_foreachScreenVert(vc, do_nurbs_box_select__doSelect, &data, V3D_PROJ_TEST_CLIP_DEFAULT); | nurbs_foreachScreenVert(vc, do_nurbs_box_select__doSelect, &data, V3D_PROJ_TEST_CLIP_DEFAULT); | ||||
| /* Deselect items that were not added to selection (indicated by temp flag). */ | /* Deselect items that were not added to selection (indicated by temp flag). */ | ||||
| if (deselect_all) { | if (deselect_all) { | ||||
| BKE_nurbList_flag_set_from_flag(nurbs, BEZT_FLAG_TEMP_TAG, SELECT); | data.is_changed |= BKE_nurbList_flag_set_from_flag(nurbs, BEZT_FLAG_TEMP_TAG, SELECT); | ||||
| } | } | ||||
| BKE_curve_nurb_vert_active_validate(vc->obedit->data); | BKE_curve_nurb_vert_active_validate(vc->obedit->data); | ||||
| return data.is_changed; | return data.is_changed; | ||||
| } | } | ||||
| static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, const float screen_co[2]) | static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, const float screen_co[2]) | ||||
| ▲ Show 20 Lines • Show All 904 Lines • ▼ Show 20 Lines | |||||
| static bool nurbscurve_circle_select(ViewContext *vc, | static bool nurbscurve_circle_select(ViewContext *vc, | ||||
| const eSelectOp sel_op, | const eSelectOp sel_op, | ||||
| const int mval[2], | const int mval[2], | ||||
| float rad) | float rad) | ||||
| { | { | ||||
| const bool select = (sel_op != SEL_OP_SUB); | const bool select = (sel_op != SEL_OP_SUB); | ||||
| const bool deselect_all = (sel_op == SEL_OP_SET); | const bool deselect_all = (sel_op == SEL_OP_SET); | ||||
| CircleSelectUserData data; | CircleSelectUserData data; | ||||
| bool changed = false; | |||||
| view3d_userdata_circleselect_init(&data, vc, select, mval, rad); | view3d_userdata_circleselect_init(&data, vc, select, mval, rad); | ||||
| Curve *curve = (Curve *)vc->obedit->data; | Curve *curve = (Curve *)vc->obedit->data; | ||||
| ListBase *nurbs = BKE_curve_editNurbs_get(curve); | ListBase *nurbs = BKE_curve_editNurbs_get(curve); | ||||
| /* For deselect all, items to be selected are tagged with temp flag. Clear that first. */ | /* For deselect all, items to be selected are tagged with temp flag. Clear that first. */ | ||||
| if (deselect_all) { | if (deselect_all) { | ||||
| BKE_nurbList_flag_set(nurbs, BEZT_FLAG_TEMP_TAG, false); | BKE_nurbList_flag_set(nurbs, BEZT_FLAG_TEMP_TAG, false); | ||||
| data.select_flag = BEZT_FLAG_TEMP_TAG; | data.select_flag = BEZT_FLAG_TEMP_TAG; | ||||
| } | } | ||||
| ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ | ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ | ||||
| nurbs_foreachScreenVert(vc, nurbscurve_circle_doSelect, &data, V3D_PROJ_TEST_CLIP_DEFAULT); | nurbs_foreachScreenVert(vc, nurbscurve_circle_doSelect, &data, V3D_PROJ_TEST_CLIP_DEFAULT); | ||||
| /* Deselect items that were not added to selection (indicated by temp flag). */ | /* Deselect items that were not added to selection (indicated by temp flag). */ | ||||
| if (deselect_all) { | if (deselect_all) { | ||||
| BKE_nurbList_flag_set_from_flag(nurbs, BEZT_FLAG_TEMP_TAG, SELECT); | data.is_changed |= BKE_nurbList_flag_set_from_flag(nurbs, BEZT_FLAG_TEMP_TAG, SELECT); | ||||
| } | } | ||||
| BKE_curve_nurb_vert_active_validate(vc->obedit->data); | BKE_curve_nurb_vert_active_validate(vc->obedit->data); | ||||
| return changed || data.is_changed; | return data.is_changed; | ||||
| } | } | ||||
| static void latticecurve_circle_doSelect(void *userData, BPoint *bp, const float screen_co[2]) | static void latticecurve_circle_doSelect(void *userData, BPoint *bp, const float screen_co[2]) | ||||
| { | { | ||||
| CircleSelectUserData *data = userData; | CircleSelectUserData *data = userData; | ||||
| if (len_squared_v2v2(data->mval_fl, screen_co) <= data->radius_squared) { | if (len_squared_v2v2(data->mval_fl, screen_co) <= data->radius_squared) { | ||||
| bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT); | bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT); | ||||
| ▲ Show 20 Lines • Show All 449 Lines • Show Last 20 Lines | |||||