diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-30 09:26:42 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-30 10:01:22 +0300 |
commit | a8ec7845e0bdb9e63e9d3dbd7f4cd7caad36b5a2 (patch) | |
tree | 4531232281ddc4cda4df3fb1ccc0822018fe5682 /source/blender/blenlib/tests/BLI_delaunay_2d_test.cc | |
parent | af3aaf80344e745e6c207102941513cb631194c3 (diff) |
Cleanup: use "num" as a suffix in: source/blender/blenlib
Also replace "num" with:
- "number" when it's not used to denote the number of items.
- "digits" when digits in a string are being manipulated.
Diffstat (limited to 'source/blender/blenlib/tests/BLI_delaunay_2d_test.cc')
-rw-r--r-- | source/blender/blenlib/tests/BLI_delaunay_2d_test.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc b/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc index bdf263d982a..25ee523ebc0 100644 --- a/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc +++ b/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc @@ -1788,7 +1788,7 @@ TEST(delaunay_d, CintTwoFaceNoIds) #if DO_TEXT_TESTS template<typename T> void text_test( - int num_arc_points, int num_lets_per_line, int num_lines, CDT_output_type otype, bool need_ids) + int arc_points_num, int lets_per_line_num, int lines_num, CDT_output_type otype, bool need_ids) { constexpr bool print_timing = true; /* @@ -1810,7 +1810,7 @@ void text_test( * * Where the numbers are the first 13 vertices, and the rest of * the vertices are in arcs a0, a1, a2, a3, each of which have - * num_arc_points per arc in them. + * arc_points_num per arc in them. */ const char *b_before_arcs = R"(13 0 3 @@ -1834,13 +1834,13 @@ void text_test( CDT_input<T> b_before_arcs_in = fill_input_from_string<T>(b_before_arcs); constexpr int narcs = 4; - int b_npts = b_before_arcs_in.vert.size() + narcs * num_arc_points; + int b_npts = b_before_arcs_in.vert.size() + narcs * arc_points_num; constexpr int b_nfaces = 3; Array<vec2<T>> b_vert(b_npts); Array<Vector<int>> b_face(b_nfaces); std::copy(b_before_arcs_in.vert.begin(), b_before_arcs_in.vert.end(), b_vert.begin()); std::copy(b_before_arcs_in.face.begin(), b_before_arcs_in.face.end(), b_face.begin()); - if (num_arc_points > 0) { + if (arc_points_num > 0) { b_face[0].pop_last(); /* We'll add center point back between arcs for outer face. */ for (int arc = 0; arc < narcs; ++arc) { int arc_origin_vert; @@ -1875,10 +1875,10 @@ void text_test( vec2<T> center_co = 0.5 * (start_co + end_co); BLI_assert(start_co[0] == end_co[0]); double radius = abs(math_to_double<T>(end_co[1] - center_co[1])); - double angle_delta = M_PI / (num_arc_points + 1); - int start_vert = b_before_arcs_in.vert.size() + arc * num_arc_points; + double angle_delta = M_PI / (arc_points_num + 1); + int start_vert = b_before_arcs_in.vert.size() + arc * arc_points_num; Vector<int> &face = b_face[(arc <= 1) ? 0 : arc - 1]; - for (int i = 0; i < num_arc_points; ++i) { + for (int i = 0; i < arc_points_num; ++i) { vec2<T> delta; float ang = ccw ? (-M_PI_2 + (i + 1) * angle_delta) : (M_PI_2 - (i + 1) * angle_delta); delta[0] = T(radius * cos(ang)); @@ -1893,7 +1893,7 @@ void text_test( } CDT_input<T> in; - int tot_instances = num_lets_per_line * num_lines; + int tot_instances = lets_per_line_num * lines_num; if (tot_instances == 1) { in.vert = b_vert; in.face = b_face; @@ -1906,8 +1906,8 @@ void text_test( T delta_x = T(2); T delta_y = T(3.25); int instance = 0; - for (int line = 0; line < num_lines; ++line) { - for (int let = 0; let < num_lets_per_line; ++let) { + for (int line = 0; line < lines_num; ++line) { + for (int let = 0; let < lets_per_line_num; ++let) { vec2<T> co_offset(cur_x, cur_y); int in_v_offset = instance * b_vert.size(); for (int v = 0; v < b_vert.size(); ++v) { @@ -1940,12 +1940,12 @@ void text_test( EXPECT_EQ(out.face_orig.size(), 0); } if (DO_DRAW) { - std::string label = "Text arcpts=" + std::to_string(num_arc_points); - if (num_lets_per_line > 1) { - label += " linelen=" + std::to_string(num_lets_per_line); + std::string label = "Text arcpts=" + std::to_string(arc_points_num); + if (lets_per_line_num > 1) { + label += " linelen=" + std::to_string(lets_per_line_num); } - if (num_lines > 1) { - label += " lines=" + std::to_string(num_lines); + if (lines_num > 1) { + label += " lines=" + std::to_string(lines_num); } if (!need_ids) { label += " no_ids"; |