Cleanup: remove redundant doxygen \file argument
[blender.git] / source / blender / bmesh / operators / bmo_inset.c
index e056948..a0b9185 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Contributor(s): Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/bmesh/operators/bmo_inset.c
- *  \ingroup bmesh
+/** \file \ingroup bmesh
  *
  * Inset face regions.
  * Inset individual faces.
- *
  */
 
 #include "MEM_guardedalloc.h"
@@ -173,7 +165,7 @@ static void bm_loop_customdata_merge(
        l_b_inner_inset = BM_edge_other_loop(e_b, l_b_inner);
        BLI_assert(l_a_inner_inset->v == l_b_inner_inset->v);
 
-       /* check if ther is no chance of diversion */
+       /* check if there is no chance of diversion */
        if (l_a_inner_inset->f == l_b_inner_inset->f) {
                return;
        }
@@ -275,7 +267,7 @@ static void bmo_face_inset_individual(
 
        BMLoop *l_iter, *l_first;
        BMLoop *l_other;
-       unsigned int i;
+       uint i;
        float e_length_prev;
 
        l_first = BM_FACE_FIRST_LOOP(f);
@@ -313,7 +305,7 @@ static void bmo_face_inset_individual(
                                                      l_iter->next->v,
                                                      l_iter->v,
                                                      f, BM_CREATE_NOP);
-               BMO_elem_flag_enable(bm, f_new_outer, ELE_NEW);
+               BMO_face_flag_enable(bm, f_new_outer, ELE_NEW);
 
                /* copy loop data */
                l_other = l_iter->radial_next;
@@ -647,6 +639,10 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
        } (void)0
 #define VERT_ORIG_GET(_v)  \
        (const float *)BLI_ghash_lookup_default(vert_coords, (_v), (_v)->co)
+       /* memory for the coords isn't given back to the arena,
+        * acceptable in this case since it runs a fixed number of times. */
+#define VERT_ORIG_REMOVE(_v)  \
+       BLI_ghash_remove(vert_coords, (_v), NULL, NULL)
 
 
        for (i = 0, es = edge_info; i < edge_info_len; i++, es++) {
@@ -659,7 +655,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
 
                /* run the separate arg */
                if (!BM_edge_is_boundary(es->e_old)) {
-                       bmesh_edge_separate(bm, es->e_old, es->l, false);
+                       bmesh_kernel_edge_separate(bm, es->e_old, es->l, false);
                }
 
                /* calc edge-split info */
@@ -738,7 +734,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
                                /* disable touching twice, this _will_ happen if the flags not disabled */
                                BM_elem_flag_disable(v, BM_ELEM_TAG);
 
-                               bmesh_vert_separate(bm, v, &vout, &r_vout_len, false);
+                               bmesh_kernel_vert_separate(bm, v, &vout, &r_vout_len, false);
                                v = NULL; /* don't use again */
 
                                /* in some cases the edge doesn't split off */
@@ -972,7 +968,11 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
                                                                v_glue = v_split;
                                                        }
                                                        else {
-                                                               BM_vert_splice(bm, v_glue, v_split);
+                                                               if (BM_vert_splice(bm, v_glue, v_split)) {
+                                                                       if (use_vert_coords_orig) {
+                                                                               VERT_ORIG_REMOVE(v_split);
+                                                                       }
+                                                               }
                                                        }
                                                }
                                        }
@@ -1037,7 +1037,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
                /* no need to check doubles, we KNOW there won't be any */
                /* yes - reverse face is correct in this case */
                f = BM_face_create_verts(bm, varr, j, es->l->f, BM_CREATE_NOP, true);
-               BMO_elem_flag_enable(bm, f, ELE_NEW);
+               BMO_face_flag_enable(bm, f, ELE_NEW);
 
                /* 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