diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 11:30:50 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 11:31:10 +0300 |
commit | c7b247a118e302a3afc6473797e53b6af28b69e2 (patch) | |
tree | d11149a165bfd8f3b3b791f24547499f041b133b /source/blender/blenlib/intern/delaunay_2d.cc | |
parent | 891949cbb47143420f4324cb60efc05ef5d70b39 (diff) |
Cleanup: replace static_casts with functional casts for numeric types
Diffstat (limited to 'source/blender/blenlib/intern/delaunay_2d.cc')
-rw-r--r-- | source/blender/blenlib/intern/delaunay_2d.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc index db6cb0824dc..6280fe1010f 100644 --- a/source/blender/blenlib/intern/delaunay_2d.cc +++ b/source/blender/blenlib/intern/delaunay_2d.cc @@ -520,10 +520,10 @@ template<typename T> void cdt_draw(const std::string &label, const CDTArrangemen double height = maxy - miny; double aspect = height / width; int view_width = max_draw_width; - int view_height = static_cast<int>(view_width * aspect); + int view_height = int(view_width * aspect); if (view_height > max_draw_height) { view_height = max_draw_height; - view_width = static_cast<int>(view_height / aspect); + view_width = int(view_height / aspect); } double scale = view_width / width; @@ -2822,8 +2822,8 @@ extern "C" ::CDT_result *BLI_delaunay_2d_cdt_calc(const ::CDT_input *input, in.edge = blender::Array<std::pair<int, int>>(input->edges_len); in.face = blender::Array<blender::Vector<int>>(input->faces_len); for (int v = 0; v < input->verts_len; ++v) { - double x = static_cast<double>(input->vert_coords[v][0]); - double y = static_cast<double>(input->vert_coords[v][1]); + double x = double(input->vert_coords[v][0]); + double y = double(input->vert_coords[v][1]); in.vert[v] = blender::meshintersect::vec2<double>(x, y); } for (int e = 0; e < input->edges_len; ++e) { @@ -2836,7 +2836,7 @@ extern "C" ::CDT_result *BLI_delaunay_2d_cdt_calc(const ::CDT_input *input, in.face[f][j] = input->faces[fstart + j]; } } - in.epsilon = static_cast<double>(input->epsilon); + in.epsilon = double(input->epsilon); in.need_ids = input->need_ids; blender::meshintersect::CDT_result<double> res = blender::meshintersect::delaunay_2d_calc( @@ -2903,8 +2903,8 @@ extern "C" ::CDT_result *BLI_delaunay_2d_cdt_calc(const ::CDT_input *input, int v_orig_index = 0; for (int v = 0; v < nv; ++v) { - output->vert_coords[v][0] = static_cast<float>(res.vert[v][0]); - output->vert_coords[v][1] = static_cast<float>(res.vert[v][1]); + output->vert_coords[v][0] = float(res.vert[v][0]); + output->vert_coords[v][1] = float(res.vert[v][1]); if (input->need_ids) { int this_start = v_orig_index; output->verts_orig_start_table[v] = this_start; |