diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-31 15:51:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-31 15:55:15 +0300 |
commit | d8dbd49a2f23b7637f05fc058f39bdf6ab706624 (patch) | |
tree | 0805b9372c82ae6505d87e879824efe1d3e32f8e /source/blender/freestyle/intern/geometry/Grid.h | |
parent | 8987f7987d8160e1f6e79e8c85d6ce65b885ab25 (diff) |
Cleanup: style, use braces in source/
Automated using clang-tidy.
Diffstat (limited to 'source/blender/freestyle/intern/geometry/Grid.h')
-rw-r--r-- | source/blender/freestyle/intern/geometry/Grid.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/geometry/Grid.h b/source/blender/freestyle/intern/geometry/Grid.h index 67aae73a578..6090eeb122a 100644 --- a/source/blender/freestyle/intern/geometry/Grid.h +++ b/source/blender/freestyle/intern/geometry/Grid.h @@ -67,8 +67,9 @@ class Cell { inline void addOccluder(Polygon3r *o) { - if (o) + if (o) { _occluders.push_back(o); + } } inline const Vec3r &getOrigin() @@ -227,12 +228,15 @@ class Grid { int tmp; for (int i = 0; i < 3; i++) { tmp = (int)((p[i] - _orig[i]) / _cell_size[i]); - if (tmp < 0) + if (tmp < 0) { res[i] = 0; - else if ((unsigned int)tmp >= _cells_nb[i]) + } + else if ((unsigned int)tmp >= _cells_nb[i]) { res[i] = _cells_nb[i] - 1; - else + } + else { res[i] = tmp; + } } } @@ -263,8 +267,9 @@ class Grid { */ inline void getCellOrigin(const Vec3u &cell_coord, Vec3r &orig) { - for (unsigned int i = 0; i < 3; i++) + for (unsigned int i = 0; i < 3; i++) { orig[i] = _orig[i] + cell_coord[i] * _cell_size[i]; + } } /*! Retrieves the box corresponding to the cell whose coordinates are passed as argument: |