[Bf-blender-cvs] [89cba08285f] soc-2019-bevel-profiles: Profile Widget: Add BKE prefix to public functions
Hans Goudey
noreply at git.blender.org
Tue Aug 6 20:02:14 CEST 2019
Commit: 89cba08285fbbf65b5b6ca9b8d7c34cbed727859
Author: Hans Goudey
Date: Tue Aug 6 14:01:59 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rB89cba08285fbbf65b5b6ca9b8d7c34cbed727859
Profile Widget: Add BKE prefix to public functions
===================================================================
M source/blender/blenkernel/BKE_profile_widget.h
M source/blender/blenkernel/intern/profile_widget.c
M source/blender/blenkernel/intern/scene.c
M source/blender/blenloader/intern/versioning_280.c
M source/blender/blenloader/intern/versioning_defaults.c
M source/blender/bmesh/tools/bmesh_bevel.c
M source/blender/editors/interface/interface_draw.c
M source/blender/editors/interface/interface_handlers.c
M source/blender/editors/interface/interface_templates.c
M source/blender/modifiers/intern/MOD_bevel.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_profile_widget.h b/source/blender/blenkernel/BKE_profile_widget.h
index 480afe804a7..524f1e09d61 100644
--- a/source/blender/blenkernel/BKE_profile_widget.h
+++ b/source/blender/blenkernel/BKE_profile_widget.h
@@ -27,55 +27,49 @@
struct ProfileWidget;
struct ProfilePoint;
-/* HANS-QUESTION: Should I add the BKE_ to the front of these functions? The CurveMapping widget
- * doesn't have them but it's mentioned in the style guide that public functions should have it */
+void BKE_profilewidget_set_defaults(struct ProfileWidget *prwdgt);
-void profilewidget_set_defaults(struct ProfileWidget *prwdgt);
+struct ProfileWidget *BKE_profilewidget_add(int preset);
-struct ProfileWidget *profilewidget_add(int preset);
+void BKE_profilewidget_free_data(struct ProfileWidget *prwdgt);
-void profilewidget_free_data(struct ProfileWidget *prwdgt);
+void BKE_profilewidget_free(struct ProfileWidget *prwdgt);
-void profilewidget_free(struct ProfileWidget *prwdgt);
+void BKE_profilewidget_copy_data(struct ProfileWidget *target, const struct ProfileWidget *prwdgt);
-void profilewidget_copy_data(struct ProfileWidget *target, const struct ProfileWidget *prwdgt);
+struct ProfileWidget *BKE_profilewidget_copy(const struct ProfileWidget *prwdgt);
-struct ProfileWidget *profilewidget_copy(const struct ProfileWidget *prwdgt);
+bool BKE_profilewidget_remove_point(struct ProfileWidget *prwdgt, struct ProfilePoint *point);
-bool profilewidget_remove_point(struct ProfileWidget *prwdgt, struct ProfilePoint *point);
+void BKE_profilewidget_remove(struct ProfileWidget *prwdgt, const short flag);
-void profilewidget_remove(struct ProfileWidget *prwdgt, const short flag);
+struct ProfilePoint *BKE_profilewidget_insert(struct ProfileWidget *prwdgt, float x, float y);
-struct ProfilePoint *profilewidget_insert(struct ProfileWidget *prwdgt, float x, float y);
+void BKE_profilewidget_handle_set(struct ProfileWidget *prwdgt, int type);
-void profilewidget_handle_set(struct ProfileWidget *prwdgt, int type);
+void BKE_profilewidget_reverse(struct ProfileWidget *prwdgt);
-void profilewidget_reverse(struct ProfileWidget *prwdgt);
+void BKE_profilewidget_reset(struct ProfileWidget *prwdgt);
-void profilewidget_reset(struct ProfileWidget *prwdgt);
-
-void profilewidget_create_samples(struct ProfileWidget *prwdgt,
+void BKE_profilewidget_create_samples(struct ProfileWidget *prwdgt,
int n_segments,
bool sample_straight_edges,
struct ProfilePoint *r_samples);
-void profilewidget_initialize(struct ProfileWidget *prwdgt, short nsegments);
+void BKE_profilewidget_initialize(struct ProfileWidget *prwdgt, short nsegments);
/* Called for a complete update of the widget after modifications */
-void profilewidget_changed(struct ProfileWidget *prwdgt, const bool rem_doubles);
-
-/* Distance in 2D to the next point */
-float profilewidget_distance_to_next_point(const struct ProfileWidget *prwdgt, int i);
+void BKE_profilewidget_changed(struct ProfileWidget *prwdgt, const bool rem_doubles);
/* Need to find the total length of the curve to sample a portion of it */
-float profilewidget_total_length(const struct ProfileWidget *prwdgt);
+float BKE_profilewidget_total_length(const struct ProfileWidget *prwdgt);
-void profilewidget_create_samples_even_spacing(const struct ProfileWidget *prwdgt,
+void BKE_profilewidget_create_samples_even_spacing(const struct ProfileWidget *prwdgt,
double *x_table_out,
double *y_table_out);
/* Length portion is the fraction of the total path length where we want the location */
-void profilewidget_evaluate_portion(const struct ProfileWidget *prwdgt,
+void BKE_profilewidget_evaluate_length_portion(const struct ProfileWidget *prwdgt,
float length_portion,
float *x_out,
float *y_out);
diff --git a/source/blender/blenkernel/intern/profile_widget.c b/source/blender/blenkernel/intern/profile_widget.c
index fa8a180611a..ceda0d2e9e3 100644
--- a/source/blender/blenkernel/intern/profile_widget.c
+++ b/source/blender/blenkernel/intern/profile_widget.c
@@ -67,7 +67,7 @@ void BKE_profilewidget_set_defaults(ProfileWidget *prwdgt)
prwdgt->changed_timestamp = 0;
}
-void profilewidget_free_data(ProfileWidget *prwdgt)
+void BKE_profilewidget_free_data(ProfileWidget *prwdgt)
{
#if DEBUG_PRWDGT
printf("PROFILEWIDGET FREE DATA\n");
@@ -89,18 +89,18 @@ void profilewidget_free_data(ProfileWidget *prwdgt)
}
}
-void profilewidget_free(ProfileWidget *prwdgt)
+void BKE_profilewidget_free(ProfileWidget *prwdgt)
{
#if DEBUG_PRWDGT
printf("PROFILEWIDGET FREE\n");
#endif
if (prwdgt) {
- profilewidget_free_data(prwdgt);
+ BKE_profilewidget_free_data(prwdgt);
MEM_freeN(prwdgt);
}
}
-void profilewidget_copy_data(ProfileWidget *target, const ProfileWidget *prwdgt)
+void BKE_profilewidget_copy_data(ProfileWidget *target, const ProfileWidget *prwdgt)
{
#if DEBUG_PRWDGT
printf("PROFILEWIDGET COPY DATA\n");
@@ -118,7 +118,7 @@ void profilewidget_copy_data(ProfileWidget *target, const ProfileWidget *prwdgt)
}
}
-ProfileWidget *profilewidget_copy(const ProfileWidget *prwdgt)
+ProfileWidget *BKE_profilewidget_copy(const ProfileWidget *prwdgt)
{
#if DEBUG_PRWDGT
printf("PROFILEWIDGET COPY\n");
@@ -126,7 +126,7 @@ ProfileWidget *profilewidget_copy(const ProfileWidget *prwdgt)
if (prwdgt) {
ProfileWidget *new_prdgt = MEM_dupallocN(prwdgt);
- profilewidget_copy_data(new_prdgt, prwdgt);
+ BKE_profilewidget_copy_data(new_prdgt, prwdgt);
return new_prdgt;
}
return NULL;
@@ -134,7 +134,7 @@ ProfileWidget *profilewidget_copy(const ProfileWidget *prwdgt)
/** Removes a specific point from the path of control points
* \note: Requiress profilewidget_changed call after */
-bool profilewidget_remove_point(ProfileWidget *prwdgt, ProfilePoint *point)
+bool BKE_profilewidget_remove_point(ProfileWidget *prwdgt, ProfilePoint *point)
{
ProfilePoint *pts;
int a, b, removed = 0;
@@ -170,7 +170,7 @@ bool profilewidget_remove_point(ProfileWidget *prwdgt, ProfilePoint *point)
/** Removes every point in the widget with the supplied flag set, except for the first and last.
* \param flag: ProfilePoint->flag
* \note: Requiress profilewidget_changed call after */
-void profilewidget_remove(ProfileWidget *prwdgt, const short flag)
+void BKE_profilewidget_remove(ProfileWidget *prwdgt, const short flag)
{
#if DEBUG_PRWDGT
printf("PROFILEPATH REMOVE\n");
@@ -203,7 +203,7 @@ void profilewidget_remove(ProfileWidget *prwdgt, const short flag)
* between is more complex for a profile. We can't just find the new neighbors with X value
* comparisons. Instead this function checks which line segment is closest to the new point.
* \note: Requiress profilewidget_changed call after */
-ProfilePoint *profilewidget_insert(ProfileWidget *prwdgt, float x, float y)
+ProfilePoint *BKE_profilewidget_insert(ProfileWidget *prwdgt, float x, float y)
{
ProfilePoint *new_pt = NULL;
float new_loc[2] = {x, y};
@@ -261,7 +261,7 @@ ProfilePoint *profilewidget_insert(ProfileWidget *prwdgt, float x, float y)
/** Sets the handle type of the selected control points.
* \param type: Either HD_VECT or HD_AUTO
* \note: Requiress profilewidget_changed call after. */
-void profilewidget_handle_set(ProfileWidget *prwdgt, int type)
+void BKE_profilewidget_handle_set(ProfileWidget *prwdgt, int type)
{
#if DEBUG_PRWDGT
printf("PROFILEPATH HANDLE SET\n");
@@ -281,7 +281,7 @@ void profilewidget_handle_set(ProfileWidget *prwdgt, int type)
/** Flips the profile across the diagonal so that its orientation is reversed.
* \note: Requiress profilewidget_changed call after. */
-void profilewidget_reverse(ProfileWidget *prwdgt)
+void BKE_profilewidget_reverse(ProfileWidget *prwdgt)
{
#if DEBUG_PRWDGT
printf("PROFILEPATH INSERT\n");
@@ -318,7 +318,7 @@ void profilewidget_reverse(ProfileWidget *prwdgt)
/** Resets the profile to the current preset.
* \note: Requiress profilewidget_changed call after */
-void profilewidget_reset(ProfileWidget *prwdgt)
+void BKE_profilewidget_reset(ProfileWidget *prwdgt)
{
#if DEBUG_PRWDGT
printf("PROFILEPATH RESET\n");
@@ -560,7 +560,7 @@ static int compare_curvature_bezt_edge_i(const BezTriple *bezt, const int i_a, c
* \return r_samples: Fill the array with the sampled locations and if the point corresponds
* to a control point, its handle type */
/* HANS-TODO: This is getting called way too much: when the mouse moves over the bevel modifier UI */
-void profilewidget_create_samples(ProfileWidget *prwdgt,
+void BKE_profilewidget_create_samples(ProfileWidget *prwdgt,
int n_segments,
bool sample_straight_edges,
ProfilePoint *r_samples)
@@ -735,7 +735,7 @@ static void profilewidget_make_table(ProfileWidget *prwdgt)
ProfilePoint *new_table = MEM_callocN((size_t)(n_samples + 1) * sizeof(ProfilePoint),
"high-res table");
- profilewidget_create_samples(prwdgt, n_samples, false, new_table);
+ BKE_profilewidget_create_samples(prwdgt, n_samples, false, new_table);
if (prwdgt->table) {
MEM_freeN(prwdgt->table);
@@ -758,7 +758,7 @@ static void profilewidget_make_segments_table(ProfileWidget *prwdgt)
ProfilePoint *new_table = MEM_callocN((size_t)(n_samples + 1) * sizeof(ProfilePoint),
"samples table");
- profilewidget_create_samples(prwdgt, n_samples, prwdgt->flag & PROF_SAMPLE_STRAIGHT_EDGES,
+ BKE_profilewidget_create_samples(prwdgt, n_samples, prwdgt->flag & PROF_SAMPLE_STRAIGHT_EDGES,
new_table);
if (prwdgt->segments) {
@@ -767,7 +767,7 @@ static void profilewidget_make_segments_table(ProfileWidget *prwdgt)
prwdgt->segments = new_table;
}
-struct ProfileWidget *profilewidget_add(int pre
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list