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/stroke/CurveAdvancedIterators.h | |
parent | 8987f7987d8160e1f6e79e8c85d6ce65b885ab25 (diff) |
Cleanup: style, use braces in source/
Automated using clang-tidy.
Diffstat (limited to 'source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h')
-rw-r--r-- | source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h b/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h index 5cbdd26be57..9999950e240 100644 --- a/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h +++ b/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h @@ -119,10 +119,12 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr _CurvilinearLength = iBrother._CurvilinearLength; _step = iBrother._step; _t = iBrother._t; - if (iBrother._Point == 0) + if (iBrother._Point == 0) { _Point = 0; - else + } + else { _Point = new Point(*(iBrother._Point)); + } _n = iBrother._n; _currentn = iBrother._currentn; } @@ -136,10 +138,12 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr _CurvilinearLength = iBrother._CurvilinearLength; _step = iBrother._step; _t = iBrother._t; - if (iBrother._Point == 0) + if (iBrother._Point == 0) { _Point = 0; - else + } + else { _Point = new Point(*(iBrother._Point)); + } _n = iBrother._n; _currentn = iBrother._currentn; } @@ -154,10 +158,12 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr _CurvilinearLength = iBrother._CurvilinearLength; _step = iBrother._step; _t = iBrother._t; - if (iBrother._Point == 0) + if (iBrother._Point == 0) { _Point = 0; - else + } + else { _Point = new Point(*(iBrother._Point)); + } _n = iBrother._n; _currentn = iBrother._currentn; return *this; @@ -165,8 +171,9 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr virtual ~__point_iterator() { - if (_Point != 0) + if (_Point != 0) { delete _Point; + } } // protected: //FIXME @@ -243,8 +250,9 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr delete _Point; _Point = 0; } - if ((_currentn < 0) || (_currentn >= _n)) + if ((_currentn < 0) || (_currentn >= _n)) { return _Point; // 0 in this case + } return (_Point = new Point(*__A, *__B, _t)); } @@ -255,15 +263,17 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr virtual bool begin() const { - if ((__A == _begin) && (_t < (float)M_EPSILON)) + if ((__A == _begin) && (_t < (float)M_EPSILON)) { return true; + } return false; } virtual bool end() const { - if ((__B == _end)) + if ((__B == _end)) { return true; + } return false; } @@ -334,8 +344,9 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr --_currentn; --__A; --__B; - if (_currentn == _n - 1) + if (_currentn == _n - 1) { return; + } } if (0 == _step) { // means we iterate over initial vertices @@ -358,13 +369,16 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr } // round value - if (fabs(_t) < (float)M_EPSILON) + if (fabs(_t) < (float)M_EPSILON) { _t = 0.0f; + } if (_t < 0) { - if (_currentn == 0) + if (_currentn == 0) { _CurvilinearLength = 0.0f; - else + } + else { _CurvilinearLength += normAB * (-_t); + } _t = 0.0f; } } |