Cleanup: Use const arguments

This commit is contained in:
Hans Goudey 2022-05-13 19:13:31 +02:00
parent 7c9b6cc380
commit c2bbd01b2f
6 changed files with 18 additions and 18 deletions

View File

@ -79,7 +79,7 @@ typedef struct CameraParams {
void BKE_camera_params_init(CameraParams *params);
void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob);
void BKE_camera_params_from_view3d(CameraParams *params,
struct Depsgraph *depsgraph,
const struct Depsgraph *depsgraph,
const struct View3D *v3d,
const struct RegionView3D *rv3d);

View File

@ -302,7 +302,7 @@ void BKE_camera_params_from_object(CameraParams *params, const Object *cam_ob)
}
void BKE_camera_params_from_view3d(CameraParams *params,
Depsgraph *depsgraph,
const Depsgraph *depsgraph,
const View3D *v3d,
const RegionView3D *rv3d)
{

View File

@ -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,

View File

@ -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 &region,
RegionView3D &rv3d,
Object &object)
const ARegion &region,
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);
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);
Curves &curves_id = *static_cast<Curves *>(curves_object.data);
CurvesGeometry &curves = CurvesGeometry::wrap(curves_id.geometry);
Object *surface_object = curves_id.surface;
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(

View File

@ -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],

View File

@ -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,