Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-29 15:04:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-29 15:06:26 +0300
commitee192a35e8a0122e39c3d4d12eb62a2e26344ca7 (patch)
treeca2fcb25ca59c1cac73d53f579d56e8b88ee1dce /source/blender/bmesh/operators
parentd17e07274ab376ce518c132e36ebc44e4c4fccb4 (diff)
Cleanup: comments (long lines) in bmesh
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r--source/blender/bmesh/operators/bmo_bridge.c7
-rw-r--r--source/blender/bmesh/operators/bmo_connect_pair.c9
-rw-r--r--source/blender/bmesh/operators/bmo_create.c4
-rw-r--r--source/blender/bmesh/operators/bmo_dissolve.c18
-rw-r--r--source/blender/bmesh/operators/bmo_inset.c17
-rw-r--r--source/blender/bmesh/operators/bmo_join_triangles.c3
-rw-r--r--source/blender/bmesh/operators/bmo_normals.c38
-rw-r--r--source/blender/bmesh/operators/bmo_primitive.c10
-rw-r--r--source/blender/bmesh/operators/bmo_removedoubles.c3
-rw-r--r--source/blender/bmesh/operators/bmo_rotate_edges.c15
10 files changed, 76 insertions, 48 deletions
diff --git a/source/blender/bmesh/operators/bmo_bridge.c b/source/blender/bmesh/operators/bmo_bridge.c
index 39ccc0c631e..7ec73412373 100644
--- a/source/blender/bmesh/operators/bmo_bridge.c
+++ b/source/blender/bmesh/operators/bmo_bridge.c
@@ -211,8 +211,11 @@ static void bridge_loop_pair(BMesh *bm,
* +--------+ +--------+
* </pre>
*
- * When loops are aligned to the direction between the loops values of 'dir_a/b' is degenerate,
- * in this case compare the original directions (before they were corrected by 'el_dir'), see: T43013
+ * When loops are aligned to the direction between
+ * the loops values of 'dir_a/b' is degenerate,
+ * in this case compare the original directions
+ * (before they were corrected by 'el_dir'),
+ * see: T43013
*/
test_a = dir_a_orig;
test_b = dir_b_orig;
diff --git a/source/blender/bmesh/operators/bmo_connect_pair.c b/source/blender/bmesh/operators/bmo_connect_pair.c
index 18568c364d6..07ead2b8a96 100644
--- a/source/blender/bmesh/operators/bmo_connect_pair.c
+++ b/source/blender/bmesh/operators/bmo_connect_pair.c
@@ -43,9 +43,11 @@
* - never step over the same element twice (tag elements as #ELE_TOUCHED).
* this avoids going into an eternal loop if there are many possible branches (see T45582).
* - when running into a branch, create a new #PathLinkState state and add to the heap.
- * - when the target is reached, finish - since none of the other paths can be shorter then the one just found.
+ * - when the target is reached,
+ * finish - since none of the other paths can be shorter then the one just found.
* - if the connection can't be found - fail.
- * - with the connection found, split all edges tagging verts (or tag verts that sit on the intersection).
+ * - with the connection found, split all edges tagging verts
+ * (or tag verts that sit on the intersection).
* - run the standard connect operator.
*/
@@ -520,7 +522,8 @@ static void bm_vert_pair_to_matrix(BMVert *v_pair[2], float r_unit_mat[3][3])
project_plane_normalized_v3_v3v3(basis_nor_a, v_pair[0]->no, basis_dir);
project_plane_normalized_v3_v3v3(basis_nor_b, v_pair[1]->no, basis_dir);
- /* don't normalize before combining so as normals approach the direction, they have less effect (T46784). */
+ /* Don't normalize before combining so as normals approach the direction,
+ * they have less effect (T46784). */
/* combine the normals */
/* for flipped faces */
diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c
index c799b177843..c6813a864a8 100644
--- a/source/blender/bmesh/operators/bmo_create.c
+++ b/source/blender/bmesh/operators/bmo_create.c
@@ -230,8 +230,8 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
*
* Rather then do nothing, when 5+ verts are selected, check if they are in our history,
* when this is so, we can make edges from them, but _not_ a face,
- * if it is the intention to make a face the user can just hit F again since there will be edges next
- * time around.
+ * if it is the intention to make a face the user can just hit F again
+ * since there will be edges next time around.
*
* if all history verts have ELE_NEW flagged and the total number of history verts == totv,
* then we know the history contains all verts here and we can continue...
diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c
index 9cea982f6bd..6c662323ec1 100644
--- a/source/blender/bmesh/operators/bmo_dissolve.c
+++ b/source/blender/bmesh/operators/bmo_dissolve.c
@@ -161,15 +161,15 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
BLI_array_clear(faces);
faces = NULL; /* forces different allocatio */
- BMW_init(
- &regwalker,
- bm,
- BMW_ISLAND_MANIFOLD,
- BMW_MASK_NOP,
- BMW_MASK_NOP,
- FACE_MARK,
- BMW_FLAG_NOP, /* no need to check BMW_FLAG_TEST_HIDDEN, faces are already marked by the bmo */
- BMW_NIL_LAY);
+ BMW_init(&regwalker,
+ bm,
+ BMW_ISLAND_MANIFOLD,
+ BMW_MASK_NOP,
+ BMW_MASK_NOP,
+ FACE_MARK,
+ /* no need to check BMW_FLAG_TEST_HIDDEN, faces are already marked by the bmo. */
+ BMW_FLAG_NOP,
+ BMW_NIL_LAY);
for (f_iter = BMW_begin(&regwalker, f); f_iter; f_iter = BMW_step(&regwalker)) {
BLI_array_append(faces, f_iter);
diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c
index eede35ae7b7..12ec4617f0a 100644
--- a/source/blender/bmesh/operators/bmo_inset.c
+++ b/source/blender/bmesh/operators/bmo_inset.c
@@ -659,7 +659,8 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
BM_edge_calc_face_tangent(es->e_new, es->l, es->no);
if (es->e_new == es->e_old) { /* happens on boundary edges */
- /* take care here, we're creating this double edge which _must_ have its verts replaced later on */
+ /* Take care here, we're creating this double edge which _must_
+ * have its verts replaced later on. */
es->e_old = BM_edge_create(bm, es->e_new->v1, es->e_new->v2, es->e_new, BM_CREATE_NOP);
}
@@ -709,9 +710,10 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
}
#endif
- /* execute the split and position verts, it would be most obvious to loop over verts
- * here but don't do this since we will be splitting them off (iterating stuff you modify is bad juju)
- * instead loop over edges then their verts */
+ /* Execute the split and position verts, it would be most obvious to loop
+ * over verts here but don't do this since we will be splitting them off
+ * (iterating stuff you modify is bad juju)
+ * instead loop over edges then their verts. */
for (i = 0, es = edge_info; i < edge_info_len; i++, es++) {
for (int j = 0; j < 2; j++) {
v = (j == 0) ? es->e_new->v1 : es->e_new->v2;
@@ -1048,7 +1050,8 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
/* Copy for loop data, otherwise UV's and vcols are no good.
* tiny speedup here we could be more clever and copy from known adjacent data
- * also - we could attempt to interpolate the loop data, this would be much slower but more useful too */
+ * also - we could attempt to interpolate the loop data,
+ * this would be much slower but more useful too. */
if (0) {
/* Don't use this because face boundaries have no adjacent loops and won't be filled in.
* instead copy from the opposite side with the code below */
@@ -1163,8 +1166,8 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
float(*varr_co)[3];
BMOIter oiter;
- /* we need to re-calculate tagged normals, but for this purpose we can copy tagged verts from the
- * faces they inset from, */
+ /* We need to re-calculate tagged normals,
+ * but for this purpose we can copy tagged verts from the faces they inset from. */
for (i = 0, es = edge_info; i < edge_info_len; i++, es++) {
zero_v3(es->e_new->v1->no);
zero_v3(es->e_new->v2->no);
diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c
index 9734dab7ca4..848669301c3 100644
--- a/source/blender/bmesh/operators/bmo_join_triangles.c
+++ b/source/blender/bmesh/operators/bmo_join_triangles.c
@@ -42,7 +42,8 @@ static float quad_calc_error(const float v1[3],
const float v3[3],
const float v4[3])
{
- /* gives a 'weight' to a pair of triangles that join an edge to decide how good a join they would make */
+ /* Gives a 'weight' to a pair of triangles that join an edge
+ * to decide how good a join they would make. */
/* Note: this is more complicated than it needs to be and should be cleaned up.. */
float error = 0.0f;
diff --git a/source/blender/bmesh/operators/bmo_normals.c b/source/blender/bmesh/operators/bmo_normals.c
index ee55165244b..b24afc0f8e6 100644
--- a/source/blender/bmesh/operators/bmo_normals.c
+++ b/source/blender/bmesh/operators/bmo_normals.c
@@ -44,7 +44,8 @@ static bool bmo_recalc_normal_loop_filter_cb(const BMLoop *l, void *UNUSED(user_
* This uses a more comprehensive test to see if the furthest face from the center
* is pointing towards the center or not.
*
- * A simple test could just check the dot product of the faces-normal and the direction from the center,
+ * A simple test could just check the dot product
+ * of the faces-normal and the direction from the center,
* however this can fail for faces which make a sharp spike. eg:
*
* <pre>
@@ -67,7 +68,8 @@ static bool bmo_recalc_normal_loop_filter_cb(const BMLoop *l, void *UNUSED(user_
*/
/**
- * \return a face index in \a faces and set \a r_is_flip if the face is flipped away from the center.
+ * \return a face index in \a faces and set \a r_is_flip
+ * if the face is flipped away from the center.
*/
static int recalc_face_normals_find_index(BMesh *bm,
BMFace **faces,
@@ -83,16 +85,23 @@ static int recalc_face_normals_find_index(BMesh *bm,
int f_start_index;
int i;
- /* Search for the best loop. Members are compared in-order defined here. */
+ /** Search for the best loop. Members are compared in-order defined here. */
struct {
- /* Squared distance from the center to the loops vertex 'l->v'.
- * The normalized direction between the center and this vertex is also used for the dot-products below. */
+ /**
+ * Squared distance from the center to the loops vertex 'l->v'.
+ * The normalized direction between the center and this vertex
+ * is also used for the dot-products below.
+ */
float dist_sq;
- /* Signed dot product using the normalized edge vector,
- * (best of 'l->prev->v' or 'l->next->v'). */
+ /**
+ * Signed dot product using the normalized edge vector,
+ * (best of 'l->prev->v' or 'l->next->v').
+ */
float edge_dot;
- /* Unsigned dot product using the loop-normal
- * (sign is used to check if we need to flip) */
+ /**
+ * Unsigned dot product using the loop-normal
+ * (sign is used to check if we need to flip).
+ */
float loop_dot;
} best, test;
@@ -247,13 +256,14 @@ static void bmo_recalc_face_normals_array(BMesh *bm,
}
}
-/*
- * put normal to the outside, and set the first direction flags in edges
+/**
+ * Put normal to the outside, and set the first direction flags in edges
*
- * then check the object, and set directions / direction-flags: but only for edges with 1 or 2 faces
- * this is in fact the 'select connected'
+ * then check the object, and set directions / direction-flags:
+ * but only for edges with 1 or 2 faces this is in fact the 'select connected'
*
- * in case all faces were not done: start over with 'find the ultimate ...' */
+ * in case all faces were not done: start over with 'find the ultimate ...'.
+ */
void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
{
diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index 3ed74d68317..cf3d6b8bf56 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -941,8 +941,8 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
BMLoop *l;
BMIter fiter, liter;
- /* We cannot tag faces for UVs computing above, so we have to do it now, based on all its vertices
- * being tagged. */
+ /* We cannot tag faces for UVs computing above,
+ * so we have to do it now, based on all its vertices being tagged. */
BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) {
bool valid = true;
@@ -1537,7 +1537,8 @@ void BM_mesh_calc_uvs_cone(BMesh *bm,
const float uv_width = 1.0f / (float)segments;
const float uv_height = cap_ends ? 0.5f : 1.0f;
- /* Note that all this allows us to handle all cases (real cone, truncated cone, with or without ends capped)
+ /* Note that all this allows us to handle all cases
+ * (real cone, truncated cone, with or without ends capped)
* with a single common code. */
const float uv_center_y = cap_ends ? 0.25f : 0.5f;
const float uv_center_x_top = cap_ends ? 0.25f : 0.5f;
@@ -1601,7 +1602,8 @@ void BM_mesh_calc_uvs_cone(BMesh *bm,
}
}
else {
- /* top or bottom face - so unwrap it by transforming back to a circle and using the X/Y coords */
+ /* Top or bottom face - so unwrap it by transforming
+ * back to a circle and using the X/Y coords. */
BM_face_normal_update(f);
BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c
index 144d944e939..efebff5ccb6 100644
--- a/source/blender/bmesh/operators/bmo_removedoubles.c
+++ b/source/blender/bmesh/operators/bmo_removedoubles.c
@@ -182,7 +182,8 @@ finally : {
}
/**
- * \note with 'targetmap', multiple 'keys' are currently supported, though no callers should be using.
+ * \note with 'targetmap', multiple 'keys' are currently supported,
+ * though no callers should be using.
* (because slot maps currently use GHash without the GHASH_FLAG_ALLOW_DUPES flag set)
*/
void bmo_weld_verts_exec(BMesh *bm, BMOperator *op)
diff --git a/source/blender/bmesh/operators/bmo_rotate_edges.c b/source/blender/bmesh/operators/bmo_rotate_edges.c
index b999e942d10..56eaac03970 100644
--- a/source/blender/bmesh/operators/bmo_rotate_edges.c
+++ b/source/blender/bmesh/operators/bmo_rotate_edges.c
@@ -151,14 +151,17 @@ static void bm_rotate_edges_shared(
if (ok) {
float cost = bm_edge_calc_rotate_cost(e);
if (pass_type == PASS_TYPE_BOUNDARY) {
- /* Trick to ensure once started, non boundaries are handled before other boundary edges.
+ /* Trick to ensure once started,
+ * non boundaries are handled before other boundary edges.
* This means the first longest boundary defines the starting point which is rotated
- * until all its connected edges are exhausted and the next boundary is popped off the heap.
+ * until all its connected edges are exhausted
+ * and the next boundary is popped off the heap.
*
* Without this we may rotate from different starting points and meet in the middle
* with obviously uneven topology.
*
- * Move from negative to positive value, inverting so large values are still handled first.
+ * Move from negative to positive value,
+ * inverting so large values are still handled first.
*/
cost = cost != 0.0f ? -1.0f / cost : FLT_MAX;
}
@@ -190,10 +193,12 @@ static void bm_rotate_edges_shared(
/* Note: we could validate all edges which have not been rotated
* (not just previously degenerate edges).
- * However there is no real need - they can be left until they're popped off the queue. */
+ * However there is no real need -
+ * they can be left until they're popped off the queue. */
/* We don't know the exact topology after rotating the edge,
- * so loop over all faces attached to the new edge, typically this will only be two faces. */
+ * so loop over all faces attached to the new edge,
+ * typically this will only be two faces. */
BMLoop *l_radial_iter = e_rotate->l;
do {
/* Skip this edge. */