Cleanup: rename mesh looptri/tessface functions
authorCampbell Barton <ideasman42@gmail.com>
Sun, 25 Aug 2019 04:32:47 +0000 (14:32 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 25 Aug 2019 06:45:47 +0000 (16:45 +1000)
Use consistent terminology.

14 files changed:
source/blender/blenkernel/BKE_editmesh.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/intern/editmesh.c
source/blender/blenkernel/intern/editmesh_bvh.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_evaluate.c
source/blender/blenkernel/intern/mesh_merge.c
source/blender/editors/include/ED_mesh.h
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_relations.c
source/blender/editors/transform/transform_generics.c
source/blender/makesrna/intern/rna_object.c

index 6e4132cbc35e83db24b665a71499068a7148b889..c4f02dea5c705b35cdf311f9f85c677a860fb621 100644 (file)
@@ -79,7 +79,7 @@ typedef struct BMEditMesh {
 } BMEditMesh;
 
 /* editmesh.c */
-void BKE_editmesh_tessface_calc(BMEditMesh *em);
+void BKE_editmesh_looptri_calc(BMEditMesh *em);
 BMEditMesh *BKE_editmesh_create(BMesh *bm, const bool do_tessellate);
 BMEditMesh *BKE_editmesh_copy(BMEditMesh *em);
 BMEditMesh *BKE_editmesh_from_object(struct Object *ob);
index ef8977559851a4f366dcda18d8faeabecc6f4268..cfbece9457ee41654f5de0a0c13aa6a4372b0786 100644 (file)
@@ -537,14 +537,14 @@ void BKE_mesh_tangent_loops_to_tessdata(struct CustomData *fdata,
                                         unsigned int (*loopindices)[4],
                                         const int num_faces,
                                         const char *layer_name);
-int BKE_mesh_recalc_tessellation(struct CustomData *fdata,
-                                 struct CustomData *ldata,
-                                 struct CustomData *pdata,
-                                 struct MVert *mvert,
-                                 int totface,
-                                 int totloop,
-                                 int totpoly,
-                                 const bool do_face_nor_copy);
+int BKE_mesh_tessface_calc_ex(struct CustomData *fdata,
+                              struct CustomData *ldata,
+                              struct CustomData *pdata,
+                              struct MVert *mvert,
+                              int totface,
+                              int totloop,
+                              int totpoly,
+                              const bool do_face_nor_copy);
 void BKE_mesh_recalc_looptri(const struct MLoop *mloop,
                              const struct MPoly *mpoly,
                              const struct MVert *mvert,
index 4f4aeab721b30a1befcfda2382f6de2a0b60a0cf..866c494d35484c66bac02a05e38661eef94f591e 100644 (file)
@@ -39,7 +39,7 @@ BMEditMesh *BKE_editmesh_create(BMesh *bm, const bool do_tessellate)
 
   em->bm = bm;
   if (do_tessellate) {
-    BKE_editmesh_tessface_calc(em);
+    BKE_editmesh_looptri_calc(em);
   }
 
   return em;
@@ -126,7 +126,7 @@ static void editmesh_tessface_calc_intern(BMEditMesh *em)
   BM_mesh_calc_tessellation(em->bm, em->looptris, &em->tottri);
 }
 
-void BKE_editmesh_tessface_calc(BMEditMesh *em)
+void BKE_editmesh_looptri_calc(BMEditMesh *em)
 {
   editmesh_tessface_calc_intern(em);
 
index f23276d7be0a659e0476f37f78d59a67fc633ff8..5af4e4c00239d35d77fb5f2501dbefb435d6d4fc 100644 (file)
@@ -73,7 +73,7 @@ BMBVHTree *BKE_bmbvh_new_ex(BMesh *bm,
   BMFace *f_test, *f_test_prev;
   bool test_fn_ret;
 
-  /* BKE_editmesh_tessface_calc() must be called already */
+  /* BKE_editmesh_looptri_calc() must be called already */
   BLI_assert(looptris_tot != 0 || bm->totface == 0);
 
   if (cos_cage) {
index 6102fec963ee5385e40c8428da4d1f99b8eba7fd..68dfc263d3e1ea71285c1c4d89b0d14bcfd161e9 100644 (file)
@@ -1438,7 +1438,7 @@ void BKE_mesh_ensure_navmesh(Mesh *me)
 
 void BKE_mesh_tessface_calc(Mesh *mesh)
 {
-  mesh->totface = BKE_mesh_recalc_tessellation(
+  mesh->totface = BKE_mesh_tessface_calc_ex(
       &mesh->fdata,
       &mesh->ldata,
       &mesh->pdata,
index 7430bc148584ba0c1b646f0579e0ec4e324dda9a..38762109167224664401242368aca5d090a5c617 100644 (file)
@@ -2945,14 +2945,14 @@ void BKE_mesh_tangent_loops_to_tessdata(CustomData *fdata,
  *
  * \return number of tessellation faces.
  */
-int BKE_mesh_recalc_tessellation(CustomData *fdata,
-                                 CustomData *ldata,
-                                 CustomData *pdata,
-                                 MVert *mvert,
-                                 int totface,
-                                 int totloop,
-                                 int totpoly,
-                                 const bool do_face_nor_copy)
+int BKE_mesh_tessface_calc_ex(CustomData *fdata,
+                              CustomData *ldata,
+                              CustomData *pdata,
+                              MVert *mvert,
+                              int totface,
+                              int totloop,
+                              int totpoly,
+                              const bool do_face_nor_copy)
 {
   /* use this to avoid locking pthread for _every_ polygon
    * and calling the fill function */
index 71cc20c78b72a7048cef814287b164466c8b6a04..ae808b853230960e977550a1dca399817c8017a4 100644 (file)
@@ -235,7 +235,7 @@ static bool poly_gset_compare_fn(const void *k1, const void *k2)
  * but the additional checks are costly and not necessary in the case of mirror,
  * because each vertex is only merged to its own mirror.
  *
- * \note #BKE_mesh_recalc_tessellation has to run on the returned DM
+ * \note #BKE_mesh_tessface_calc_ex has to run on the returned DM
  * if you want to access tessfaces.
  */
 Mesh *BKE_mesh_merge_verts(Mesh *mesh,
index 949c16ff26a455f28ef1f9f1c4042f73d626a6c4..233a8161020f05b0af06014c7f38dc891d46f806 100644 (file)
@@ -105,7 +105,9 @@ bool EDBM_vert_color_check(struct BMEditMesh *em);
 bool EDBM_mesh_hide(struct BMEditMesh *em, bool swap);
 bool EDBM_mesh_reveal(struct BMEditMesh *em, bool select);
 
-void EDBM_update_generic(struct BMEditMesh *em, const bool do_tessface, const bool is_destructive);
+void EDBM_update_generic(struct BMEditMesh *em,
+                         const bool do_tessellation,
+                         const bool is_destructive);
 
 struct UvElementMap *BM_uv_element_map_create(struct BMesh *bm,
                                               const bool selected,
index 748de60abc949b8e6d3a62c53c509a0dec3af9e6..522c2f32d27bb4c0d2456c1ce03cbf6ae3ae9585 100644 (file)
@@ -85,7 +85,7 @@ void EDBM_redo_state_restore(BMBackup backup, BMEditMesh *em, int recalctess)
   tmpbm = NULL;
 
   if (recalctess) {
-    BKE_editmesh_tessface_calc(em);
+    BKE_editmesh_looptri_calc(em);
   }
 }
 
@@ -105,7 +105,7 @@ void EDBM_redo_state_free(BMBackup *backup, BMEditMesh *em, int recalctess)
   backup->bmcopy = NULL;
 
   if (recalctess && em) {
-    BKE_editmesh_tessface_calc(em);
+    BKE_editmesh_looptri_calc(em);
   }
 }
 
@@ -162,7 +162,7 @@ bool EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const bool
     /* when copying, tessellation isn't to for faster copying,
      * but means we need to re-tessellate here */
     if (em->looptris == NULL) {
-      BKE_editmesh_tessface_calc(em);
+      BKE_editmesh_looptri_calc(em);
     }
 
     if (em->ob) {
@@ -1389,15 +1389,15 @@ void EDBM_stats_update(BMEditMesh *em)
 
 /* so many tools call these that we better make it a generic function.
  */
-void EDBM_update_generic(BMEditMesh *em, const bool do_tessface, const bool is_destructive)
+void EDBM_update_generic(BMEditMesh *em, const bool do_tessellation, const bool is_destructive)
 {
   Object *ob = em->ob;
   /* order of calling isn't important */
   DEG_id_tag_update(ob->data, ID_RECALC_GEOMETRY);
   WM_main_add_notifier(NC_GEOM | ND_DATA, ob->data);
 
-  if (do_tessface) {
-    BKE_editmesh_tessface_calc(em);
+  if (do_tessellation) {
+    BKE_editmesh_looptri_calc(em);
   }
 
   if (is_destructive) {
index 12f7ecb89dd2704cd23d718ed8effd99ffc78dad..0c2b52927166ad662c696641bf13dea24e57927e 100644 (file)
@@ -594,7 +594,7 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag
     if (LIKELY(em)) {
       /* order doesn't matter */
       EDBM_mesh_normals_update(em);
-      BKE_editmesh_tessface_calc(em);
+      BKE_editmesh_looptri_calc(em);
     }
 
     WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_MESH, NULL);
index 1576dc3bbb8dab52043449a9d4c4936be12577d1..bcbf7ddf9a67bee35014cdfbbde22de08a43a562 100644 (file)
@@ -352,7 +352,7 @@ static bool object_hook_index_array(Main *bmain,
       em = me->edit_mesh;
 
       EDBM_mesh_normals_update(em);
-      BKE_editmesh_tessface_calc(em);
+      BKE_editmesh_looptri_calc(em);
 
       /* check selected vertices first */
       if (return_editmesh_indexar(em, r_tot, r_indexar, r_cent) == 0) {
index 739f05e0b675194cfbfb9bf0361cf7f6b1e2add7..67364f275dd715d96634395bb67dcc4836c7d8b1 100644 (file)
@@ -149,7 +149,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
     em = me->edit_mesh;
 
     EDBM_mesh_normals_update(em);
-    BKE_editmesh_tessface_calc(em);
+    BKE_editmesh_looptri_calc(em);
 
     /* Make sure the evaluated mesh is updated.
      *
index 9c564bcfa545f818b4c770e6fae26ab5e97be358..41eb5f1e8120afac4b7c5e5ed240f189abc4c154 100644 (file)
@@ -901,7 +901,7 @@ static void recalcData_objects(TransInfo *t)
         DEG_id_tag_update(tc->obedit->data, 0); /* sets recalc flags */
         BMEditMesh *em = BKE_editmesh_from_object(tc->obedit);
         EDBM_mesh_normals_update(em);
-        BKE_editmesh_tessface_calc(em);
+        BKE_editmesh_looptri_calc(em);
       }
     }
     else if (t->obedit_type == OB_ARMATURE) { /* no recalc flag, does pose */
index e43fe912fc3ac3e1ae44dc4373c7c3e512446ca1..d605aa6b4f7275e5ba4af89ca980e52cfeef43b0 100644 (file)
@@ -403,7 +403,7 @@ static void rna_Object_active_shape_update(bContext *C, PointerRNA *ptr)
         DEG_id_tag_update(ob->data, 0);
 
         EDBM_mesh_normals_update(((Mesh *)ob->data)->edit_mesh);
-        BKE_editmesh_tessface_calc(((Mesh *)ob->data)->edit_mesh);
+        BKE_editmesh_looptri_calc(((Mesh *)ob->data)->edit_mesh);
         break;
       case OB_CURVE:
       case OB_SURF: