diff options
author | Hans Goudey <h.goudey@me.com> | 2021-05-16 02:00:20 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-05-16 02:00:20 +0300 |
commit | 9dabb342ba5e3b439fc960b303df8de1ada4a960 (patch) | |
tree | 747f5f80dd7418c4108acc3135dcd8ac5b3c5fec /source/blender/blenkernel/intern/geometry_component_curve.cc | |
parent | 4da16a0707bbb1feb03e728eb89eb773871f978c (diff) |
Cleanup: Improve comments
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_curve.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_curve.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index b0d2d661cd5..44c5cce92dd 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -447,8 +447,8 @@ template<typename T> class VMutableArray_For_SplinePoints final : public VMutabl /** * Virtual array implementation specifically for control point positions. This is only needed for - * Bezier splines, where adjusting the position also needs to adjust handle positions depending on - * the handle types. We pay a small price for this when other spline types are mixed with Bezier. + * Bezier splines, where adjusting the position also requires adjusting handle positions depending + * on handle types. We pay a small price for this when other spline types are mixed with Bezier. * * \note There is no need to check the handle type to avoid changing auto handles, since * retrieving write access to the position data will mark them for recomputation anyway. @@ -534,7 +534,7 @@ class VMutableArray_For_SplinePosition final : public VMutableArray<float3> { /** * Provider for any builtin control point attribute that doesn't need - * special handling such as access to other arrays in the spline. + * special handling like access to other arrays in the spline. */ template<typename T> class BuiltinPointAttributeProvider : public BuiltinAttributeProvider { protected: @@ -630,7 +630,7 @@ template<typename T> class BuiltinPointAttributeProvider : public BuiltinAttribu }; /** - * Special attribute provider for the position attribute. Having this separate means we don't + * Special attribute provider for the position attribute. Keeping this separate means we don't * need to make #BuiltinPointAttributeProvider overly generic, and the special handling for the * positions is more clear. */ @@ -653,8 +653,6 @@ class PositionAttributeProvider final : public BuiltinPointAttributeProvider<flo return {}; } - /* Changing the positions requires recalculation of cached evaluated data in many cases. - * This could set more specific flags in the future to avoid unnecessary recomputation. */ bool curve_has_bezier_spline = false; for (SplinePtr &spline : curve->splines()) { if (spline->type() == Spline::Type::Bezier) { @@ -663,12 +661,14 @@ class PositionAttributeProvider final : public BuiltinPointAttributeProvider<flo } } - /* Use the regular position virtual array there are any bezier splines to potentially avoid - * using the special position virtual array when there are no Bezier splines anyway. */ + /* Use the regular position virtual array when there aren't any Bezier splines + * to avoid the overhead of thecking the spline type for every point. */ if (!curve_has_bezier_spline) { return BuiltinPointAttributeProvider<float3>::try_get_for_write(component); } + /* Changing the positions requires recalculation of cached evaluated data in many cases. + * This could set more specific flags in the future to avoid unnecessary recomputation. */ for (SplinePtr &spline : curve->splines()) { spline->mark_cache_invalid(); } @@ -687,8 +687,8 @@ class PositionAttributeProvider final : public BuiltinPointAttributeProvider<flo * \{ */ /** - * 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. + * 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. */ static ComponentAttributeProviders create_attribute_providers_for_curve() { |