[Bf-blender-cvs] [c9af025936e] master: Cleanup: Add doxygen sections, rearrange functions
Hans Goudey
noreply at git.blender.org
Mon Oct 4 01:24:14 CEST 2021
Commit: c9af025936e8c660d5dbad86a6554a13e72d0457
Author: Hans Goudey
Date: Sun Oct 3 18:23:58 2021 -0500
Branches: master
https://developer.blender.org/rBc9af025936e8c660d5dbad86a6554a13e72d0457
Cleanup: Add doxygen sections, rearrange functions
===================================================================
M source/blender/blenkernel/intern/curveprofile.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/curveprofile.cc b/source/blender/blenkernel/intern/curveprofile.cc
index 0adce991d0f..c16459afbb3 100644
--- a/source/blender/blenkernel/intern/curveprofile.cc
+++ b/source/blender/blenkernel/intern/curveprofile.cc
@@ -35,6 +35,10 @@
#include "BLO_read_write.h"
+/* -------------------------------------------------------------------- */
+/** \name Data Handling
+ * \{ */
+
void BKE_curveprofile_free_data(CurveProfile *profile)
{
MEM_SAFE_FREE(profile->path);
@@ -74,6 +78,33 @@ CurveProfile *BKE_curveprofile_copy(const CurveProfile *profile)
return nullptr;
}
+void BKE_curveprofile_blend_write(struct BlendWriter *writer, const struct CurveProfile *profile)
+{
+ BLO_write_struct(writer, CurveProfile, profile);
+ BLO_write_struct_array(writer, CurveProfilePoint, profile->path_len, profile->path);
+}
+
+/* Expects that the curve profile itself has been read already. */
+void BKE_curveprofile_blend_read(struct BlendDataReader *reader, struct CurveProfile *profile)
+{
+ BLO_read_data_address(reader, &profile->path);
+ profile->table = nullptr;
+ profile->segments = nullptr;
+
+ /* Reset the points' pointers to the profile. */
+ for (int i = 0; i < profile->path_len; i++) {
+ profile->path[i].profile = profile;
+ }
+
+ BKE_curveprofile_init(profile, profile->segments_len);
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Editing
+ * \{ */
+
/**
* Move a point's handle, accounting for the alignment of handles with the #HD_ALIGN type.
*
@@ -532,6 +563,12 @@ void BKE_curveprofile_reset(CurveProfile *profile)
profile->table = nullptr;
}
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Sampling and Evaluation
+ * \{ */
+
/**
* Helper for 'curve_profile_create' samples.
* Returns whether both handles that make up the edge are vector handles.
@@ -1103,23 +1140,4 @@ void BKE_curveprofile_evaluate_length_portion(const CurveProfile *profile,
*y_out = interpf(profile->table[i].y, profile->table[i + 1].y, lerp_factor);
}
-void BKE_curveprofile_blend_write(struct BlendWriter *writer, const struct CurveProfile *profile)
-{
- BLO_write_struct(writer, CurveProfile, profile);
- BLO_write_struct_array(writer, CurveProfilePoint, profile->path_len, profile->path);
-}
-
-/* Expects that the curve profile itself has been read already. */
-void BKE_curveprofile_blend_read(struct BlendDataReader *reader, struct CurveProfile *profile)
-{
- BLO_read_data_address(reader, &profile->path);
- profile->table = nullptr;
- profile->segments = nullptr;
-
- /* Reset the points' pointers to the profile. */
- for (int i = 0; i < profile->path_len; i++) {
- profile->path[i].profile = profile;
- }
-
- BKE_curveprofile_init(profile, profile->segments_len);
-}
+/** \} */
More information about the Bf-blender-cvs
mailing list