diff options
author | Hans Goudey <h.goudey@me.com> | 2021-05-19 20:02:53 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-05-19 20:02:53 +0300 |
commit | 192a3f1a05d00f1f10f32861c098b66f78cff3e4 (patch) | |
tree | 479224c98f48754e47dd2940cbb460af5a5eed4d /source/blender/blenkernel/BKE_spline.hh | |
parent | 330fecc9b7f69c11258ea926ce760e51b4f3dd78 (diff) |
Cleanup: Use copy constructor for CurveEval
There is no need for a special "copy" method with a copy constructor,
which will be necessary to explicitly copy attributes anyway.
Diffstat (limited to 'source/blender/blenkernel/BKE_spline.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_spline.hh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh index 35f21ccb897..c3386d12b02 100644 --- a/source/blender/blenkernel/BKE_spline.hh +++ b/source/blender/blenkernel/BKE_spline.hh @@ -482,14 +482,20 @@ class CurveEval { blender::Vector<SplinePtr> splines_; public: + CurveEval() = default; + CurveEval(const CurveEval &other) + { + for (const SplinePtr &spline : other.splines()) { + this->add_spline(spline->copy()); + } + } + blender::Span<SplinePtr> splines() const; blender::MutableSpan<SplinePtr> splines(); void add_spline(SplinePtr spline); void remove_splines(blender::IndexMask mask); - CurveEval *copy(); - void translate(const blender::float3 &translation); void transform(const blender::float4x4 &matrix); void bounds_min_max(blender::float3 &min, blender::float3 &max, const bool use_evaluated) const; |