diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-23 01:37:58 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-23 01:37:58 +0300 |
commit | 5b4732f81ca8a159e937336fba7c8eb3220216de (patch) | |
tree | 4c0ab34fda202c209cbc99934a5355feec26af49 /source/blender/blenkernel/BKE_spline.hh | |
parent | 0b9cc6725cca193ec20868caf266ea35c173b956 (diff) |
Cleanup: Use new enum for CurveEval handle types
This will make the transition to the new curves data structure
a bit simple, since the handle types can be copied directly between
the two. The change to CurveEval is simple because it is runtime-only.
Diffstat (limited to 'source/blender/blenkernel/BKE_spline.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_spline.hh | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh index 846dcd3ca8e..646af6f8f98 100644 --- a/source/blender/blenkernel/BKE_spline.hh +++ b/source/blender/blenkernel/BKE_spline.hh @@ -10,6 +10,8 @@ #include "FN_generic_virtual_array.hh" +#include "DNA_curves_types.h" + #include "BLI_float4x4.hh" #include "BLI_math_vec_types.hh" #include "BLI_vector.hh" @@ -252,26 +254,13 @@ class Spline { * factors and indices in a list of floats, which is then used to interpolate any other data. */ class BezierSpline final : public Spline { - public: - enum class HandleType { - /** The handle can be moved anywhere, and doesn't influence the point's other handle. */ - Free, - /** The location is automatically calculated to be smooth. */ - Auto, - /** The location is calculated to point to the next/previous control point. */ - Vector, - /** The location is constrained to point in the opposite direction as the other handle. */ - Align, - }; - - private: blender::Vector<blender::float3> positions_; blender::Vector<float> radii_; blender::Vector<float> tilts_; int resolution_; - blender::Vector<HandleType> handle_types_left_; - blender::Vector<HandleType> handle_types_right_; + blender::Vector<int8_t> handle_types_left_; + blender::Vector<int8_t> handle_types_right_; /* These are mutable to allow lazy recalculation of #Auto and #Vector handle positions. */ mutable blender::Vector<blender::float3> handle_positions_left_; @@ -323,8 +312,8 @@ class BezierSpline final : public Spline { blender::Span<float> radii() const final; blender::MutableSpan<float> tilts() final; blender::Span<float> tilts() const final; - blender::Span<HandleType> handle_types_left() const; - blender::MutableSpan<HandleType> handle_types_left(); + blender::Span<int8_t> handle_types_left() const; + blender::MutableSpan<int8_t> handle_types_left(); blender::Span<blender::float3> handle_positions_left() const; /** * Get writable access to the handle position. @@ -333,8 +322,8 @@ class BezierSpline final : public Spline { * uninitialized memory while auto-generating handles. */ blender::MutableSpan<blender::float3> handle_positions_left(bool write_only = false); - blender::Span<HandleType> handle_types_right() const; - blender::MutableSpan<HandleType> handle_types_right(); + blender::Span<int8_t> handle_types_right() const; + blender::MutableSpan<int8_t> handle_types_right(); blender::Span<blender::float3> handle_positions_right() const; /** * Get writable access to the handle position. |