From a5761bbde206e31bd03e2092b52040c8d297feff Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 10 May 2021 19:30:23 -0500 Subject: Cleanup: Whitespace, add doxygen sections The sections aren't helpful at the moment, but I will add more code here soon that will benefit more from the visual separation. --- .../blenkernel/intern/geometry_component_curve.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/geometry_component_curve.cc') diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index 503670861a5..7afecb66bcc 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -115,7 +115,7 @@ void CurveComponent::ensure_owns_direct_data() /** \} */ /* -------------------------------------------------------------------- */ -/** \name Attribute Access +/** \name Attribute Access Helper Functions * \{ */ int CurveComponent::attribute_domain_size(const AttributeDomain domain) const @@ -150,12 +150,19 @@ static const CurveEval *get_curve_from_component_for_read(const GeometryComponen return curve_component.get_for_read(); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Builtin Spline Attributes + * + * Attributes with a value for every spline, stored contiguously or in every spline separately. + * \{ */ + namespace blender::bke { class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider { using AsReadAttribute = GVArrayPtr (*)(const CurveEval &data); using AsWriteAttribute = GVMutableArrayPtr (*)(CurveEval &data); - using UpdateOnWrite = void (*)(Spline &spline); const AsReadAttribute as_read_attribute_; const AsWriteAttribute as_write_attribute_; @@ -182,7 +189,6 @@ class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider { if (curve == nullptr) { return {}; } - return as_read_attribute_(*curve); } @@ -195,7 +201,6 @@ class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider { if (curve == nullptr) { return {}; } - return as_write_attribute_(*curve); } @@ -278,6 +283,12 @@ static GVMutableArrayPtr make_cyclic_write_attribute(CurveEval &curve) curve.splines.as_mutable_span()); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Attribute Provider Declaration + * \{ */ + /** * In this function all the attribute providers for a curve component are created. Most data * in this function is statically allocated, because it does not change over time. -- cgit v1.2.3