[Bf-blender-cvs] [b87eb766776] soc-2019-bevel-profiles: More renaming: "prwdgt" -> "profile" and others
Hans Goudey
noreply at git.blender.org
Thu Oct 24 21:27:03 CEST 2019
Commit: b87eb766776ffcbc86e16c646d6529e766395f2e
Author: Hans Goudey
Date: Thu Oct 24 21:26:23 2019 +0200
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rBb87eb766776ffcbc86e16c646d6529e766395f2e
More renaming: "prwdgt" -> "profile" and others
===================================================================
M source/blender/blenkernel/BKE_curveprofile.h
M source/blender/blenkernel/intern/curveprofile.c
M source/blender/blenkernel/intern/scene.c
M source/blender/blenloader/intern/readfile.c
M source/blender/blenloader/intern/versioning_280.c
M source/blender/blenloader/intern/versioning_defaults.c
M source/blender/blenloader/intern/writefile.c
M source/blender/bmesh/intern/bmesh_opdefines.c
M source/blender/bmesh/operators/bmo_bevel.c
M source/blender/bmesh/tools/bmesh_bevel.c
M source/blender/bmesh/tools/bmesh_bevel.h
M source/blender/editors/interface/interface_draw.c
M source/blender/editors/interface/interface_handlers.c
M source/blender/editors/interface/interface_intern.h
M source/blender/editors/interface/interface_templates.c
M source/blender/editors/mesh/editmesh_bevel.c
M source/blender/makesdna/DNA_curveprofile_types.h
M source/blender/makesdna/DNA_scene_types.h
M source/blender/makesrna/intern/rna_curveprofile.c
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_curveprofile.h b/source/blender/blenkernel/BKE_curveprofile.h
index 0a01bc67651..1f11e5c406f 100644
--- a/source/blender/blenkernel/BKE_curveprofile.h
+++ b/source/blender/blenkernel/BKE_curveprofile.h
@@ -27,49 +27,49 @@
struct CurveProfile;
struct CurveProfilePoint;
-void BKE_curveprofile_set_defaults(struct CurveProfile *prwdgt);
+void BKE_curveprofile_set_defaults(struct CurveProfile *profile);
struct CurveProfile *BKE_curveprofile_add(int preset);
-void BKE_curveprofile_free_data(struct CurveProfile *prwdgt);
+void BKE_curveprofile_free_data(struct CurveProfile *profile);
-void BKE_curveprofile_free(struct CurveProfile *prwdgt);
+void BKE_curveprofile_free(struct CurveProfile *profile);
-void BKE_curveprofile_copy_data(struct CurveProfile *target, const struct CurveProfile *prwdgt);
+void BKE_curveprofile_copy_data(struct CurveProfile *target, const struct CurveProfile *profile);
-struct CurveProfile *BKE_curveprofile_copy(const struct CurveProfile *prwdgt);
+struct CurveProfile *BKE_curveprofile_copy(const struct CurveProfile *profile);
-bool BKE_curveprofile_remove_point(struct CurveProfile *prwdgt, struct CurveProfilePoint *point);
+bool BKE_curveprofile_remove_point(struct CurveProfile *profile, struct CurveProfilePoint *point);
-void BKE_curveprofile_remove_by_flag(struct CurveProfile *prwdgt, const short flag);
+void BKE_curveprofile_remove_by_flag(struct CurveProfile *profile, const short flag);
-struct CurveProfilePoint *BKE_curveprofile_insert(struct CurveProfile *prwdgt, float x, float y);
+struct CurveProfilePoint *BKE_curveprofile_insert(struct CurveProfile *profile, float x, float y);
-void BKE_curveprofile_selected_handle_set(struct CurveProfile *prwdgt, int type_1, int type_2);
+void BKE_curveprofile_selected_handle_set(struct CurveProfile *profile, int type_1, int type_2);
-void BKE_curveprofile_reverse(struct CurveProfile *prwdgt);
+void BKE_curveprofile_reverse(struct CurveProfile *profile);
-void BKE_curveprofile_reset(struct CurveProfile *prwdgt);
+void BKE_curveprofile_reset(struct CurveProfile *profile);
-void BKE_curveprofile_create_samples(struct CurveProfile *prwdgt,
+void BKE_curveprofile_create_samples(struct CurveProfile *profile,
int n_segments,
bool sample_straight_edges,
struct CurveProfilePoint *r_samples);
-void BKE_curveprofile_initialize(struct CurveProfile *prwdgt, short nsegments);
+void BKE_curveprofile_initialize(struct CurveProfile *profile, short nsegments);
/* Called for a complete update of the widget after modifications */
-void BKE_curveprofile_update(struct CurveProfile *prwdgt, const bool rem_doubles);
+void BKE_curveprofile_update(struct CurveProfile *profile, const bool rem_doubles);
/* Need to find the total length of the curve to sample a portion of it */
-float BKE_curveprofile_total_length(const struct CurveProfile *prwdgt);
+float BKE_curveprofile_total_length(const struct CurveProfile *profile);
-void BKE_curveprofile_create_samples_even_spacing(struct CurveProfile *prwdgt,
+void BKE_curveprofile_create_samples_even_spacing(struct CurveProfile *profile,
int n_segments,
struct CurveProfilePoint *r_samples);
/* Length portion is the fraction of the total path length where we want the location */
-void BKE_curveprofile_evaluate_length_portion(const struct CurveProfile *prwdgt,
+void BKE_curveprofile_evaluate_length_portion(const struct CurveProfile *profile,
float length_portion,
float *x_out,
float *y_out);
diff --git a/source/blender/blenkernel/intern/curveprofile.c b/source/blender/blenkernel/intern/curveprofile.c
index f27f15331c4..7d071f4b562 100644
--- a/source/blender/blenkernel/intern/curveprofile.c
+++ b/source/blender/blenkernel/intern/curveprofile.c
@@ -41,35 +41,35 @@
#include "BKE_curve.h"
#include "BKE_fcurve.h"
-void BKE_curveprofile_free_data(CurveProfile *prwdgt)
+void BKE_curveprofile_free_data(CurveProfile *profile)
{
- MEM_SAFE_FREE(prwdgt->path);
- MEM_SAFE_FREE(prwdgt->table);
- MEM_SAFE_FREE(prwdgt->segments);
+ MEM_SAFE_FREE(profile->path);
+ MEM_SAFE_FREE(profile->table);
+ MEM_SAFE_FREE(profile->segments);
}
-void BKE_curveprofile_free(CurveProfile *prwdgt)
+void BKE_curveprofile_free(CurveProfile *profile)
{
- if (prwdgt) {
- BKE_curveprofile_free_data(prwdgt);
- MEM_freeN(prwdgt);
+ if (profile) {
+ BKE_curveprofile_free_data(profile);
+ MEM_freeN(profile);
}
}
-void BKE_curveprofile_copy_data(CurveProfile *target, const CurveProfile *prwdgt)
+void BKE_curveprofile_copy_data(CurveProfile *target, const CurveProfile *profile)
{
- *target = *prwdgt;
+ *target = *profile;
- target->path = MEM_dupallocN(prwdgt->path);
- target->table = MEM_dupallocN(prwdgt->table);
- target->segments = MEM_dupallocN(prwdgt->segments);
+ target->path = MEM_dupallocN(profile->path);
+ target->table = MEM_dupallocN(profile->table);
+ target->segments = MEM_dupallocN(profile->segments);
}
-CurveProfile *BKE_curveprofile_copy(const CurveProfile *prwdgt)
+CurveProfile *BKE_curveprofile_copy(const CurveProfile *profile)
{
- if (prwdgt) {
- CurveProfile *new_prdgt = MEM_dupallocN(prwdgt);
- BKE_curveprofile_copy_data(new_prdgt, prwdgt);
+ if (profile) {
+ CurveProfile *new_prdgt = MEM_dupallocN(profile);
+ BKE_curveprofile_copy_data(new_prdgt, profile);
return new_prdgt;
}
return NULL;
@@ -77,73 +77,74 @@ CurveProfile *BKE_curveprofile_copy(const CurveProfile *prwdgt)
/** Removes a specific point from the path of control points.
* \note: Requires curveprofile_update call after. */
-bool BKE_curveprofile_remove_point(CurveProfile *prwdgt, CurveProfilePoint *point)
+bool BKE_curveprofile_remove_point(CurveProfile *profile, CurveProfilePoint *point)
{
CurveProfilePoint *pts;
/* Must have 2 points minimum. */
- if (prwdgt->totpoint <= 2) {
+ if (profile->totpoint <= 2) {
return false;
}
/* Input point must be within the array. */
- if (!(point > prwdgt->path && point < prwdgt->path + prwdgt->totpoint)) {
+ if (!(point > profile->path && point < profile->path + profile->totpoint)) {
return false;
}
- pts = MEM_mallocN(sizeof(CurveProfilePoint) * prwdgt->totpoint, "path points");
+ pts = MEM_mallocN(sizeof(CurveProfilePoint) * profile->totpoint, "path points");
- uint i_delete = (uint)(point - prwdgt->path);
+ uint i_delete = (uint)(point - profile->path);
/* Copy the before and after the deleted point. */
- memcpy(pts, prwdgt->path, i_delete);
- memcpy(pts + i_delete, prwdgt->path + i_delete + 1, (size_t)prwdgt->totpoint - i_delete - 1);
+ memcpy(pts, profile->path, i_delete);
+ memcpy(pts + i_delete, profile->path + i_delete + 1, (size_t)profile->totpoint - i_delete - 1);
- MEM_freeN(prwdgt->path);
- prwdgt->path = pts;
- prwdgt->totpoint -= 1;
+ MEM_freeN(profile->path);
+ profile->path = pts;
+ profile->totpoint -= 1;
return true;
}
/** Removes every point in the widget with the supplied flag set, except for the first and last.
* \param flag: CurveProfilePoint->flag.
* \note: Requires curveprofile_update call after. */
-void BKE_curveprofile_remove_by_flag(CurveProfile *prwdgt, const short flag)
+void BKE_curveprofile_remove_by_flag(CurveProfile *profile, const short flag)
{
int i_old, i_new, n_removed = 0;
/* Copy every point without the flag into the new path. */
- CurveProfilePoint *new_pts = MEM_mallocN(sizeof(CurveProfilePoint) * prwdgt->totpoint, "profile");
+ CurveProfilePoint *new_pts = MEM_mallocN(sizeof(CurveProfilePoint) * profile->totpoint,
+ "profile path");
/* Build the new list without any of the points with the flag. Keep the first and last points. */
- new_pts[0] = prwdgt->path[0];
- for (i_old = 1, i_new = 1; i_old < prwdgt->totpoint - 1; i_old++) {
- if (!(prwdgt->path[i_old].flag & flag)) {
- new_pts[i_new] = prwdgt->path[i_old];
+ new_pts[0] = profile->path[0];
+ for (i_old = 1, i_new = 1; i_old < profile->totpoint - 1; i_old++) {
+ if (!(profile->path[i_old].flag & flag)) {
+ new_pts[i_new] = profile->path[i_old];
i_new++;
}
else {
n_removed++;
}
}
- new_pts[i_new] = prwdgt->path[i_old];
+ new_pts[i_new] = profile->path[i_old];
- MEM_freeN(prwdgt->path);
- prwdgt->path = new_pts;
- prwdgt->totpoint -= n_removed;
+ MEM_freeN(profile->path);
+ profile->path = new_pts;
+ profile->totpoint -= n_removed;
}
/** Adds a new point at the specified location. The choice for which points to place the new vertex
* between is made by checking which control point line segment is closest to the new point and
* placing the new vertex in between that segment's points.
* \note: Requires curveprofile_update call after. */
-CurveProfilePoint *BKE_curveprofile_insert(CurveProfile *prwdgt, float x, float y)
+CurveProfilePoint *BKE_curveprofile_insert(CurveProfile *profile, float x, float y)
{
CurveProfilePoint *new_pt = NULL;
float new_loc[2] = {x, y};
/* Don't add more control points than the maximum size of the higher resolution table. */
- if (prwdgt->totpoint == PROF_TABLE_MAX - 1) {
+ if (profile->totpoint == PROF_TABLE_MAX - 1) {
return NULL;
}
@@ -151,9 +152,9 @@ CurveProfilePoint *BKE_curveprofile_insert(CurveProfile *prwdgt, float x, float
float distance;
float min_distance = FLT_MAX;
int i_insert = 0;
- for (int i = 0; i < prwdgt->totpoint - 1; i++) {
- float loc1[2] = {prwdgt->path[i].x, prwdgt->path[i].y};
- float loc2[2] = {prwdgt->path[i + 1].x, prwdgt->path[i + 1].y};
+ for (int i = 0; i < profile->totpoint - 1; i++) {
+ float loc1[2] = {profile->path[i].x, profile->path[i].y};
+ float loc2[2] = {profile->path[i + 1].x, profile->path[i + 1].y};
distance = dist_squared_to_line_segment_v2(new_loc, loc1, loc2);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list