diff options
author | Hans Goudey <h.goudey@me.com> | 2022-03-11 23:55:42 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-03-11 23:55:42 +0300 |
commit | db7c4d7a1cf3a4aab7d40df9de5f3f3d33e88cb6 (patch) | |
tree | d1008b32109f94219bc12c6f40baab9aa0387896 /source/blender/blenkernel/intern/spline_nurbs.cc | |
parent | bd9f94e91720e6d2ce5308344e83c5a787351669 (diff) |
Cleanup: Use new enum for NURBS curve knots modes
Move the definition of the enum to `Curves` DNA, since the values
will be saved in files, and ongoing development needs to use this.
Diffstat (limited to 'source/blender/blenkernel/intern/spline_nurbs.cc')
-rw-r--r-- | source/blender/blenkernel/intern/spline_nurbs.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/spline_nurbs.cc b/source/blender/blenkernel/intern/spline_nurbs.cc index 2146a4309ab..7dc5ac3ea12 100644 --- a/source/blender/blenkernel/intern/spline_nurbs.cc +++ b/source/blender/blenkernel/intern/spline_nurbs.cc @@ -142,8 +142,8 @@ bool NURBSpline::check_valid_size_and_order() const return false; } - if (ELEM(this->knots_mode, KnotsMode::Bezier, KnotsMode::EndPointBezier)) { - if (this->knots_mode == KnotsMode::Bezier && this->size() <= order_) { + if (ELEM(this->knots_mode, NURBS_KNOT_MODE_BEZIER, NURBS_KNOT_MODE_ENDPOINT_BEZIER)) { + if (this->knots_mode == NURBS_KNOT_MODE_BEZIER && this->size() <= order_) { return false; } return (!is_cyclic_ || this->size() % (order_ - 1) == 0); @@ -162,10 +162,8 @@ void NURBSpline::calculate_knots() const { const KnotsMode mode = this->knots_mode; const int order = order_; - const bool is_bezier = ELEM( - mode, NURBSpline::KnotsMode::Bezier, NURBSpline::KnotsMode::EndPointBezier); - const bool is_end_point = ELEM( - mode, NURBSpline::KnotsMode::EndPoint, NURBSpline::KnotsMode::EndPointBezier); + const bool is_bezier = ELEM(mode, NURBS_KNOT_MODE_BEZIER, NURBS_KNOT_MODE_ENDPOINT_BEZIER); + const bool is_end_point = ELEM(mode, NURBS_KNOT_MODE_ENDPOINT, NURBS_KNOT_MODE_ENDPOINT_BEZIER); /* Inner knots are always repeated once except on Bezier case. */ const int repeat_inner = is_bezier ? order - 1 : 1; /* How many times to repeat 0.0 at the beginning of knot. */ |