diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-13 20:13:31 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-13 20:13:43 +0300 |
commit | c2bbd01b2fb0df665102b8dbf14cdc562d37b617 (patch) | |
tree | db12dfa8aea34bc38cd58281ef076630c82b7809 /source/blender/editors | |
parent | 7c9b6cc3802982bfb7a13aed37d4a032d9166fbc (diff) |
Cleanup: Use const arguments
Diffstat (limited to 'source/blender/editors')
4 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 414643dd0d6..48bd86027f9 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -700,9 +700,9 @@ void ED_view3d_win_to_vector(const struct ARegion *region, const float mval[2], * \param do_clip_planes: Optionally clip the ray by the view clipping planes. * \return success, false if the segment is totally clipped. */ -bool ED_view3d_win_to_segment_clipped(struct Depsgraph *depsgraph, +bool ED_view3d_win_to_segment_clipped(const struct Depsgraph *depsgraph, const struct ARegion *region, - struct View3D *v3d, + const struct View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], @@ -733,7 +733,7 @@ void ED_view3d_dist_range_get(const struct View3D *v3d, float r_dist_range[2]); /** * \note copies logic of #ED_view3d_viewplane_get(), keep in sync. */ -bool ED_view3d_clip_range_get(struct Depsgraph *depsgraph, +bool ED_view3d_clip_range_get(const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, float *r_clipsta, diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc b/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc index 89470772e1c..dee9615ce76 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc @@ -41,9 +41,9 @@ static std::optional<float3> find_curves_brush_position(const CurvesGeometry &cu const float3 &ray_start_cu, const float3 &ray_end_cu, const float brush_radius_re, - ARegion ®ion, - RegionView3D &rv3d, - Object &object) + const ARegion ®ion, + const RegionView3D &rv3d, + const Object &object) { /* This value might have to be adjusted based on user feedback. */ const float brush_inner_radius_re = std::min<float>(brush_radius_re, (float)UI_UNIT_X / 3.0f); @@ -146,14 +146,14 @@ std::optional<CurvesBrush3D> sample_curves_3d_brush(bContext &C, const float2 &brush_pos_re, const float brush_radius_re) { - Depsgraph *depsgraph = CTX_data_depsgraph_pointer(&C); - ARegion *region = CTX_wm_region(&C); - View3D *v3d = CTX_wm_view3d(&C); - RegionView3D *rv3d = CTX_wm_region_view3d(&C); - - Curves &curves_id = *static_cast<Curves *>(curves_object.data); - CurvesGeometry &curves = CurvesGeometry::wrap(curves_id.geometry); - Object *surface_object = curves_id.surface; + const Depsgraph *depsgraph = CTX_data_depsgraph_pointer(&C); + const ARegion *region = CTX_wm_region(&C); + const View3D *v3d = CTX_wm_view3d(&C); + const RegionView3D *rv3d = CTX_wm_region_view3d(&C); + + const Curves &curves_id = *static_cast<Curves *>(curves_object.data); + const CurvesGeometry &curves = CurvesGeometry::wrap(curves_id.geometry); + const Object *surface_object = curves_id.surface; float3 center_ray_start_wo, center_ray_end_wo; ED_view3d_win_to_segment_clipped( diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index 85d239507ce..78b873f533c 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -642,9 +642,9 @@ void ED_view3d_win_to_vector(const ARegion *region, const float mval[2], float r normalize_v3(r_out); } -bool ED_view3d_win_to_segment_clipped(struct Depsgraph *depsgraph, +bool ED_view3d_win_to_segment_clipped(const struct Depsgraph *depsgraph, const ARegion *region, - View3D *v3d, + const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index e6895c0f4a3..0306bfe70bd 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -106,7 +106,7 @@ void ED_view3d_dist_range_get(const View3D *v3d, float r_dist_range[2]) r_dist_range[1] = v3d->clip_end * 10.0f; } -bool ED_view3d_clip_range_get(Depsgraph *depsgraph, +bool ED_view3d_clip_range_get(const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, float *r_clipsta, |